Example #1
0
        public static string GetDependencyItemsProviderFullName(AttributedDomainElement domainClass)
        {
            string fullName = domainClass.GetMetaModel().Namespace;

            fullName = fullName + "." + domainClass.Name + "DependencyItemsProvider";
            return(fullName);
        }
Example #2
0
        public static bool HasRelationship(AttributedDomainElement domainClass, string name)
        {
            if (domainClass == null)
            {
                return(false);
            }

            AttributedDomainElement d = domainClass;

            while (d != null)
            {
                foreach (DomainRole r in d.RolesPlayed)
                {
                    if (r == r.Relationship.Source && r.Relationship.Source.RolePlayer.InheritanceModifier != InheritanceModifier.Abstract)
                    {
                        if (r.Relationship.Name == name)
                        {
                            return(true);
                        }
                    }
                }

                d = d.BaseElement;
            }

            return(false);
        }
Example #3
0
        public string GenerateDebuggerDisplayAttribute(AttributedDomainElement domainClass)
        {
            this.GenerationEnvironment = null;
            this.GenerateDebuggerDisplayAttributeInternal(domainClass);

            return(this.GenerationEnvironment.ToString());
        }
Example #4
0
        public static string GetModelTreeViewModelFullName(AttributedDomainElement domainClass)
        {
            string fullName = domainClass.GetMetaModel().Namespace;

            fullName = fullName + ".ViewModel.ModelTree.ModelTree" + domainClass.Name + "ViewModel";
            return(fullName);
        }
Example #5
0
        public static bool HasProperty(AttributedDomainElement domainClass, string name, SerializationRepresentationType rep)
        {
            if (domainClass == null)
            {
                return(false);
            }

            AttributedDomainElement d = domainClass;

            while (d != null)
            {
                foreach (DomainProperty p in d.Properties)
                {
                    if (p.Name == name)
                    {
                        if (p.SerializationRepresentationType == rep)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }

                d = d.BaseElement;
            }

            return(false);
        }
        /// <summary>
        /// Returns all non abstract derived classes of the given elements.
        /// </summary>
        private static List <AttributedDomainElement> GetNonAbstractDerivedElements(AttributedDomainElement child)
        {
            List <AttributedDomainElement> derivedClassesCollection = new List <AttributedDomainElement>();

            if (child is DomainClass)
            {
                ReadOnlyCollection <DomainClassReferencesBaseClass> derivedClasses =
                    DomainRoleInfo.GetElementLinks <DomainClassReferencesBaseClass>(child, DomainClassReferencesBaseClass.BaseClassDomainRoleId);
                foreach (DomainClassReferencesBaseClass c in derivedClasses)
                {
                    if (c.DerivedClass.InheritanceModifier != InheritanceModifier.Abstract)
                    {
                        derivedClassesCollection.Add(c.DerivedClass);
                    }

                    derivedClassesCollection.AddRange(GetNonAbstractDerivedElements(c.DerivedClass));
                }
            }
            else if (child is DomainRelationship)
            {
                ReadOnlyCollection <DomainRelationshipReferencesBaseRelationship> derivedClasses =
                    DomainRoleInfo.GetElementLinks <DomainRelationshipReferencesBaseRelationship>(child, DomainRelationshipReferencesBaseRelationship.BaseRelationshipDomainRoleId);
                foreach (DomainRelationshipReferencesBaseRelationship c in derivedClasses)
                {
                    if (c.DerivedRelationship.InheritanceModifier != InheritanceModifier.Abstract)
                    {
                        derivedClassesCollection.Add(c.DerivedRelationship);
                    }

                    derivedClassesCollection.AddRange(GetNonAbstractDerivedElements(c.DerivedRelationship));
                }
            }

            return(derivedClassesCollection);
        }
Example #7
0
        public static string GetPropertyGridViewModelFullName(AttributedDomainElement domainClass)
        {
            string fullName = domainClass.GetMetaModel().Namespace;

            fullName = fullName + ".ViewModel.PropertyGrid.PropertyGrid" + domainClass.Name + "ViewModel";
            return(fullName);
        }
Example #8
0
        private static int GetInheritanceDepth(AttributedDomainElement domainClass)
        {
            int i = 0;

            for (AttributedDomainElement domainClass1 = domainClass; domainClass1 != null; domainClass1 = domainClass1.GetBaseClassSafely(domainClass))
            {
                i++;
            }
            return(i);
        }
Example #9
0
        private void GenerateDebuggerDisplayAttributeInternal(AttributedDomainElement domainClass)
        {
            foreach (DomainProperty domainProperty in domainClass.Properties)
            {
                if (domainProperty.IsElementName)
                {
        #line default
        #line hidden

        #line 277 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                    this.Write("[global::System.Diagnostics.DebuggerDisplay(\"{GetType().Name,nq} (");


        #line default
        #line hidden

        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(domainProperty.Name));


        #line default
        #line hidden

        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                    this.Write(" = {");


        #line default
        #line hidden

        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetCamelCase(domainProperty.Name)));


        #line default
        #line hidden

        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                    this.Write("PropertyStorage})\")]\r\n");


        #line default
        #line hidden

        #line 279 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"

                    break;
                }
            }
        }
        private void AddDomainClassResources(AttributedDomainElement c, Dictionary <string, KeyValuePair <string, string> > resourcedStrings, string commentString, string propertyCommentString)
        {
            string fullName = c.GetFullName(false);

            resourcedStrings.Add(fullName + ".Description", new KeyValuePair <string, string>(c.Description, String.Format(CultureInfo.CurrentCulture, commentString, "Description", "DomainClass", c.Name)));
            resourcedStrings.Add(fullName + ".DisplayName", new KeyValuePair <string, string>(c.DisplayName, String.Format(CultureInfo.CurrentCulture, commentString, "DisplayName", "DomainClass", c.Name)));

            foreach (DomainProperty p in c.Properties)
            {
                resourcedStrings.Add(fullName + "/" + p.Name + ".Description", new KeyValuePair <string, string>(p.Description, String.Format(CultureInfo.CurrentCulture, propertyCommentString, "Description", "DomainProperty", p.Name, "DomainClass", c.Name)));
                resourcedStrings.Add(fullName + "/" + p.Name + ".DisplayName", new KeyValuePair <string, string>(p.DisplayName, String.Format(CultureInfo.CurrentCulture, propertyCommentString, "DisplayName", "DomainProperty", p.Name, "DomainClass", c.Name)));
                if (!String.IsNullOrEmpty(p.Category))
                {
                    resourcedStrings.Add(fullName + "/" + p.Name + ".Category", new KeyValuePair <string, string>(p.Category, String.Format(CultureInfo.CurrentCulture, propertyCommentString, "Category", "DomainProperty", p.Name, "DomainClass", c.Name)));
                }
            }
        }
Example #11
0
 public static string GetSerializerBaseName(AttributedDomainElement domainClass)
 {
     if (domainClass.BaseElement != null)
     {
         string fullName = domainClass.BaseElement.GetMetaModel().Namespace;
         fullName = fullName + "." + domainClass.BaseElement.GetMetaModel().Name + domainClass.BaseElement.Name + "Serializer";
         return(fullName);
     }
     else
     {
         if (domainClass is DomainClass)
         {
             return("DslEditorModeling::SerializationDomainClassXmlSerializer");
         }
         else
         {
             return("DslEditorModeling::SerializationDomainRelationshipXmlSerializer");
         }
     }
 }
        /// <summary>
        /// Returns a collection of ModelTreeChildElementCreationInfo for the given domain class.
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public static Collection <ModelTreeChildElementCreationInfo> GetModelTreeChildElementCreationInfo(DomainClass d)
        {
            DomainClass domainClass = d;
            SortedDictionary <string, ModelTreeChildElementCreationInfo> connections = new SortedDictionary <string, ModelTreeChildElementCreationInfo>();
            Collection <ModelTreeChildElementCreationInfo> connectionsRet            = new Collection <ModelTreeChildElementCreationInfo>();

            foreach (DomainRole r in domainClass.RolesPlayed)
            {
                if (r.Relationship is EmbeddingRelationship && r.Relationship.Source == r && r.Relationship.InheritanceModifier != InheritanceModifier.Abstract)
                {
                    EmbeddingRelationship emb = r.Relationship as EmbeddingRelationship;

                    ModelTreeChildElementCreationInfo info    = new ModelTreeChildElementCreationInfo();
                    List <AttributedDomainElement>    classes = new List <AttributedDomainElement>();
                    info.Role           = r.Opposite;
                    info.TargetElements = new List <AttributedDomainElement>();

                    if (emb.Target.RolePlayer.InheritanceModifier != InheritanceModifier.Abstract)
                    {
                        classes.Add(emb.Target.RolePlayer);
                    }

                    connections.Add(emb.Target.Name, info);

                    // include derived classes o the child side
                    AttributedDomainElement child = emb.Target.RolePlayer;
                    classes.AddRange(GetNonAbstractDerivedElements(child));

                    // sort by inheritance
                    info.TargetElements.AddRange(SortDomainClassesByInheritance(classes));
                }
            }

            foreach (string key in connections.Keys)
            {
                connectionsRet.Add(connections[key]);
            }

            return(connectionsRet);
        }
        /// <summary>
        /// Constructor. This view model constructed with 'bHookUpEvents=true' does react on model changes.
        /// </summary>
        /// <param name="viewModelStore">The store this view model belongs to.</param>
        /// <param name="element">Element represented by this view model.</param>
        /// <param name="bHookUpEvents">Hook up into model events to update the created view model on changes in model if true.</param>
        public BaseAttributeElementViewModel(ViewModelStore viewModelStore, AttributedDomainElement element)
            : base(viewModelStore, element)
        {
            this.propertiesVM   = new ObservableCollection <DomainPropertyViewModel>();
            this.propertiesVMRO = new ReadOnlyObservableCollection <DomainPropertyViewModel>(propertiesVM);

            if (this.Element != null)
            {
                foreach (DomainProperty p in element.Properties)
                {
                    AddProperty(p);
                }

                this.EventManager.GetEvent <ModelElementLinkAddedEvent>().Subscribe(this.Store.DomainDataDirectory.GetDomainRelationship(AttributedDomainElementHasProperties.DomainClassId),
                                                                                    true, this.Element.Id, new Action <ElementAddedEventArgs>(OnDomainPropertyAdded));

                this.EventManager.GetEvent <ModelElementLinkDeletedEvent>().Subscribe(this.Store.DomainDataDirectory.GetDomainRelationship(AttributedDomainElementHasProperties.DomainClassId),
                                                                                      true, this.Element.Id, new Action <ElementDeletedEventArgs>(OnDomainPropertyRemoved));

                this.EventManager.GetEvent <ModelElementPropertyChangedEvent>().Subscribe(this.Element.Id, new Action <ElementPropertyChangedEventArgs>(OnElementPropertyChanged));
            }
        }
        /// <summary>
        /// Constructor. This view model constructed with 'bHookUpEvents=true' does react on model changes.
        /// </summary>
        /// <param name="viewModelStore">The store this view model belongs to.</param>
        /// <param name="element">Element represented by this view model.</param>
        /// <param name="bHookUpEvents">Hook up into model events to update the created view model on changes in model if true.</param>
        public BaseAttributeElementViewModel(ViewModelStore viewModelStore, AttributedDomainElement element)
            : base(viewModelStore, element)
        {
            this.propertiesVM = new ObservableCollection<DomainPropertyViewModel>();
            this.propertiesVMRO = new ReadOnlyObservableCollection<DomainPropertyViewModel>(propertiesVM);

            if (this.Element != null)
            {
                foreach (DomainProperty p in element.Properties)
                {
                    AddProperty(p);
                }

                this.EventManager.GetEvent<ModelElementLinkAddedEvent>().Subscribe(this.Store.DomainDataDirectory.GetDomainRelationship(AttributedDomainElementHasProperties.DomainClassId),
                    true, this.Element.Id, new Action<ElementAddedEventArgs>(OnDomainPropertyAdded));

                this.EventManager.GetEvent<ModelElementLinkDeletedEvent>().Subscribe(this.Store.DomainDataDirectory.GetDomainRelationship(AttributedDomainElementHasProperties.DomainClassId),
                    true, this.Element.Id, new Action<ElementDeletedEventArgs>(OnDomainPropertyRemoved));

                this.EventManager.GetEvent<ModelElementPropertyChangedEvent>().Subscribe(this.Element.Id, new Action<ElementPropertyChangedEventArgs>(OnElementPropertyChanged));
            }
        }
Example #15
0
 /// <summary>
 /// Adds a new referece relationship instance.
 /// </summary>
 /// <param name="source">Domain class representing the source.</param>
 /// <param name="target">Domain class representing the target.</param>
 public static void AddNewReferenceRelationship(List <DomainClass> sources, AttributedDomainElement target)
 {
     ModelTreeHelper.AddNewReferenceRelationship(sources, target);
 }
 /// <summary>
 /// Adds a new referece relationship instance.
 /// </summary>
 /// <param name="source">Domain class representing the source.</param>
 /// <param name="target">Domain class representing the target.</param>
 public static void AddNewReferenceRelationship(List<DomainClass> sources, AttributedDomainElement target)
 {
     ModelTreeHelper.AddNewReferenceRelationship(sources, target);
 }
Example #17
0
        private void GenerateResourceAttributesInternal(ModelElement domainObj, string genResourceName)
        {
            if (domainObj == null)
            {
                return;
            }

            string resourceKey         = "";
            string domainModelType     = "";
            string className           = "";
            bool   generateCategory    = false;
            bool   generateDisplayName = false;

            MetaModel dm = null;

            if (domainObj is DomainClass)
            {
                generateDisplayName = true;
                DomainClass c = (DomainClass)domainObj;
                resourceKey = c.GetFullName(false);
                dm          = c.GetMetaModel();
                className   = CodeGenerationUtilities.GetGenerationClassName(c);
            }
            else if (domainObj is DomainRelationship)
            {
                generateDisplayName = true;
                DomainRelationship c = (DomainRelationship)domainObj;
                resourceKey = c.GetFullName(false);
                dm          = c.GetMetaModel();
                className   = CodeGenerationUtilities.GetGenerationClassName(c);
            }
            else if (domainObj is DomainProperty)
            {
                generateDisplayName = true;
                DomainProperty          p = (DomainProperty)domainObj;
                AttributedDomainElement c = p.Element;
                resourceKey      = c.GetFullName(false) + "/" + p.Name;
                generateCategory = !String.IsNullOrEmpty(p.Category);

                dm = c.GetMetaModel();

                //if( c is DomainClass )
                //	dm = (c as DomainClass).GetMetaModel();
                //else
                //	dm = (c as DomainRelationship).GetMetaModel();
            }
            else if (domainObj is DomainRole)
            {
                generateDisplayName = true;
                DomainRole r = (DomainRole)domainObj;
                generateCategory = !String.IsNullOrEmpty(r.Category);
                DomainRelationship rel = r.Relationship;
                resourceKey = rel.GetFullName(false) + "/" + r.Name;
                dm          = rel.GetMetaModel();
            }
            else if (domainObj is EnumerationLiteral)
            {
                //generateDisplayName = true;
                EnumerationLiteral literal    = (EnumerationLiteral)domainObj;
                DomainEnumeration  domainEnum = literal.DomainEnumeration;
                dm          = domainEnum.MetaModel;
                resourceKey = domainEnum.GetFullName(false) + "/" + literal.Name;
            }
            else if (domainObj is MetaModel)
            {
                generateDisplayName = true;
                dm          = (MetaModel)domainObj;
                resourceKey = dm.GetFullName(false) + "DomainModel";
            }
            domainModelType = dm.GetFullName(true) + "DomainModel";

            // If no resource name specified for DslLibrary, don't generate any resource attributes.
            if (String.IsNullOrEmpty(dm.GeneratedResourceName))
            {
                return;
            }

            if (generateDisplayName)
            {
        #line default
        #line hidden

        #line 179 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write("[DslDesign::DisplayNameResource(\"");


        #line default
        #line hidden

        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(resourceKey));


        #line default
        #line hidden

        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(".DisplayName\", typeof(");


        #line default
        #line hidden

        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(domainModelType));


        #line default
        #line hidden

        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write("), \"");


        #line default
        #line hidden

        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(genResourceName));


        #line default
        #line hidden

        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write("\")]\r\n");


        #line default
        #line hidden

        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            }
            if (generateCategory)
            {
        #line default
        #line hidden

        #line 185 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write("[DslDesign::CategoryResource(\"");


        #line default
        #line hidden

        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(resourceKey));


        #line default
        #line hidden

        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(".Category\", typeof(");


        #line default
        #line hidden

        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(domainModelType));


        #line default
        #line hidden

        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write("), \"");


        #line default
        #line hidden

        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(genResourceName));


        #line default
        #line hidden

        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write("\")]\r\n");


        #line default
        #line hidden

        #line 187 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            }


        #line default
        #line hidden

        #line 189 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            this.Write("[DslDesign::DescriptionResource(\"");


        #line default
        #line hidden

        #line 190 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(resourceKey));


        #line default
        #line hidden

        #line 190 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            this.Write(".Description\", typeof(");


        #line default
        #line hidden

        #line 190 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(domainModelType));


        #line default
        #line hidden

        #line 190 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            this.Write("), \"");


        #line default
        #line hidden

        #line 190 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(genResourceName));


        #line default
        #line hidden

        #line 190 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            this.Write("\")]\r\n");


        #line default
        #line hidden

        #line 191 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"

            if (domainObj is DomainClass)
            {
        #line default
        #line hidden

        #line 194 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write("[DslModeling::DomainModelOwner(typeof(");


        #line default
        #line hidden

        #line 195 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(domainModelType));


        #line default
        #line hidden

        #line 195 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
                this.Write("))]\r\n");


        #line default
        #line hidden

        #line 196 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\Utilities.tt"
            }
        }
Example #18
0
        public static DataTemplateViewModel CreateBindablePropertiesTemplate(BaseModelElementViewModel vm)
        {
            ModelElement            modelElement      = vm.GetHostedElement();
            AttributedDomainElement attrDomainElement = null;

            string specificProperties = "";

            if (modelElement is ShapeClass)
            {
                attrDomainElement = ((modelElement) as ShapeClass).DomainClass;

                specificProperties  = "*** Specific properties: *** " + "\r\n";
                specificProperties += "   AbsoluteLeft (double)" + "\r\n";
                specificProperties += "   AbsoluteTop (double)" + "\r\n";
                specificProperties += "   AbsoluteLocation (PointD(double, double))" + "\r\n";
                specificProperties += "   Bounds (RectangleD(double, double, double, double))" + "\r\n";
                specificProperties += "   CanHaveNestedChildren (bool)" + "\r\n";
                specificProperties += "   CanHaveRelativeChildren (bool)" + "\r\n";
                specificProperties += "   Height (double)" + "\r\n";
                specificProperties += "   IsHeightFixed (bool)" + "\r\n";
                specificProperties += "   IsRelativeChildShape (bool)" + "\r\n";
                specificProperties += "   IsWidthFixed (bool)" + "\r\n";
                specificProperties += "   Left (double)" + "\r\n";
                specificProperties += "   Location (PointD(double, double))" + "\r\n";
                specificProperties += "   Size (SizeD(double, double))" + "\r\n";
                specificProperties += "   TakesPartInRelationship (bool)" + "\r\n";
                specificProperties += "   Top (double)" + "\r\n";
                specificProperties += "   Width (double)" + "\r\n";
                specificProperties += "\r\n";
            }
            else if (modelElement is RelationshipShapeClass || modelElement is MappingRelationshipShapeClass)
            {
                if (modelElement is RelationshipShapeClass)
                {
                    attrDomainElement = ((modelElement) as RelationshipShapeClass).ReferenceRelationship;
                }
                else
                {
                    attrDomainElement = ((modelElement) as MappingRelationshipShapeClass).DomainClass;
                }

                specificProperties  = "*** Specific properties: *** " + "\r\n";
                specificProperties += "   EdgePoints (EdgePointViewModel(X,Y, ...))" + "\r\n";
                specificProperties += "   StartEdgePoint (IEdgePointViewModel(X,Y,...))" + "\r\n";
                specificProperties += "   MiddleEdgePoint (IEdgePointViewModel(X,Y,...))" + "\r\n";
                specificProperties += "   EndEdgePoint (IEdgePointViewModel(X,Y,...))" + "\r\n";
                specificProperties += "   Geometry (PathGeometry)" + "\r\n";
                specificProperties += "   FromAnchorAngle (double)" + "\r\n";
                specificProperties += "   ToAnchorAngle (double)" + "\r\n";
                specificProperties += "   RoutingMode (RoutingMode(Orthogonal, Straight))" + "\r\n";
                specificProperties += "\r\n";
            }

            bool   hasSpecificDomainProperties = false;
            string specificDomainProperties    = "*** Specific domain properties: *** " + "\r\n";

            if (attrDomainElement != null)
            {
                foreach (DomainProperty p in attrDomainElement.Properties)
                {
                    if (p.Type == null)
                    {
                        continue;
                    }

                    hasSpecificDomainProperties = true;
                    specificDomainProperties   += "   Element_" + p.Name + "(" + p.Type.Name + ")" + "\r\n";
                }
            }

            if (!hasSpecificDomainProperties)
            {
                specificDomainProperties = "";
            }
            else
            {
                specificDomainProperties += "\r\n";
            }

            DataTemplateViewModel template = new DataTemplateViewModel(vm.ViewModelStore,
                                                                       "Bindable Properties",

                                                                       specificProperties +

                                                                       specificDomainProperties +

                                                                       "*** General properties: *** " + "\r\n" +
                                                                       "   DomainElementName (string)" + "\r\n" +
                                                                       "   DomainElementFullName (string)" + "\r\n" +
                                                                       "   DomainElementHasName (bool)" + "\r\n" +
                                                                       "   DomainElementType (string)" + "\r\n" +
                                                                       "   DomainElementTypeDisplayName (string)" + "\r\n" +
                                                                       "   DomainElementParentHasName (bool)" + "\r\n" +
                                                                       "   DomainElementParentName (string)" + "\r\n" +
                                                                       "   DomainElementParentFullName (string)" + "\r\n" +
                                                                       "   DomainElementParentHasFirstExistingName (bool)" + "\r\n" +
                                                                       "   DomainElementParentFirstExistingName (string)" + "\r\n" +
                                                                       "   DomainElementHasParentFullPath (bool)" + "\r\n" +
                                                                       "   DomainElementParentFullPath (string)");

            template.ImageUri           = "/Tum.PDE.LanguageDSL.Visualization;component/Resources/Images/Properties-32x32.png";
            template.Description        = "These are bindable properties you can utilize in your data templates. ";
            template.SyntaxHighlighting = "C#";

            return(template);
        }