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

            fullName = fullName + ".ViewModel.ModelTree.ModelTree" + domainClass.Name + "ViewModel";
            return(fullName);
        }
Beispiel #2
0
        public static string GetPropertyGridViewModelFullName(AttributedDomainElement domainClass)
        {
            string fullName = domainClass.GetMetaModel().Namespace;

            fullName = fullName + ".ViewModel.PropertyGrid.PropertyGrid" + domainClass.Name + "ViewModel";
            return(fullName);
        }
Beispiel #3
0
        public static string GetDependencyItemsProviderFullName(AttributedDomainElement domainClass)
        {
            string fullName = domainClass.GetMetaModel().Namespace;

            fullName = fullName + "." + domainClass.Name + "DependencyItemsProvider";
            return(fullName);
        }
Beispiel #4
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"
            }
        }