Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 504941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:32:52+00:00 2026-05-13T06:32:52+00:00

In my custom DSL tool I want a node in its Explorer which cannot

  • 0

In my custom DSL tool I want a node in its Explorer which cannot be removed. Other than that, I want it to be like a regular node. Basically what I want is a node like the Xml Serialization Behavior in the DSL Explorer:

Xml Serialization Behavior context menu illustration http://img31.imageshack.us/img31/740/xmlserializerbehavior.png

Through using Reflector on the XmlSerializationDefinitionSerializer class in the Microsoft.VisualStudio.Modeling.Sdk.DslDefinition.dll assembly I’ve discovered that it’s just a derivative of DomainClass, so there’s nothing (obviously) special about it.

I’ve defined a DomainClass that functions as the node, and right clicking it lets me add sub-nodes just the way I want it to work, I just can’t get rid of that Delete menu choice:

Delete context menu item illustration http://img705.imageshack.us/img705/9033/validators.png

I’ve tried anything that I can think of… I’ve set the property setter to private, it gets around that, I’ve set the multiplicity to 1..1, that has no effect other than giving errors when the “Validators” node is missing… I’ve looked at all the properties both for the DomainClass and for the DomainRelationship between the root model and the Validators Domain Class and none of them seem to deal with this. I’ve also looked at everything in the Explorer Behavior node in the DSL Explorer window. I’m completely stumped. Does anybody know how to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:32:52+00:00Added an answer on May 13, 2026 at 6:32 am

    Okay, after quite a bit of extensive research, I found out how to do this. Here’s what I did, in case anybody else needs the answer to my question in the future. You must create a partial class for your DSL model’s DesignerExplorer (It’s in the DslPackage project, created by the ModelExplorer.tt file) and put the following code in it:

    internal partial class MyDesignerExplorer
    {
        /// <summary>
        /// Override to stop the "Delete" command appearing for
        /// Validators.
        /// </summary>
        protected override void ProcessOnStatusDeleteCommand( MenuCommand command )
        {
            // Check the selected items to see if they contain
            // Validators.
            if( this.SelectedElement.GetType()== typeof( Validators ) ) 
            {
                // Disable the menu command
                command.Enabled = false;
                command.Visible = false;
            }
            else
            {
                // Otherwise, delegate to the base method.
                base.ProcessOnStatusDeleteCommand( command );
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 291k
  • Answers 291k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Maybe you missed including of needed namespace? I can't say… May 13, 2026 at 6:00 pm
  • Editorial Team
    Editorial Team added an answer Try a running total field - you can use formulas… May 13, 2026 at 6:00 pm
  • Editorial Team
    Editorial Team added an answer sort | uniq -c It sorts it and the count… May 13, 2026 at 6:00 pm

Related Questions

I only have a vague hint of spec so far, but I'm just testing
I am developping a DSL with its own graphical editor. Such files have a
Google's not coming to my rescue, here, and I just know this is the
We have a system whose behavior is defined by a number of XML files.(Roughly
In my custom aspx page in WSS I am using a DataFormWebPart with an

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.