public void GenerateDomainClass(DomainClass domainClass)
        {
            //string baseClass = "DslModeling::ModelElement";
            string baseClass = "DslEditorModeling::DomainModelElement";

            baseClass = CodeGenerationUtilities.GetBaseClass(domainClass, baseClass);

            string namespaceString = domainClass.Namespace;

            if (!string.IsNullOrEmpty(namespaceString))
            {
        #line default
        #line hidden

        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("namespace ");


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

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

                PushIndent("\t");
            }

            int inheritanceDepth = CodeGenerationUtilities.CalculateInheritanceDepth(domainClass);

            this.Write(Utilities.Instance.GenerateSummary("DomainClass", domainClass, true));
            if (domainClass.GeneratesDoubleDerived)
            {
                if (inheritanceDepth > 6)
                {
        #line default
        #line hidden

        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("[global::System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Maintainabili" +
                               "ty\", \"CA1501:AvoidExcessiveInheritance\", Justification = \"Generated code.\")]\r\n");


        #line default
        #line hidden

        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                }
            }
            else if (inheritanceDepth > 5)
            {
        #line default
        #line hidden

        #line 45 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("[global::System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Maintainabili" +
                           "ty\", \"CA1501:AvoidExcessiveInheritance\", Justification = \"Generated code.\")]\r\n");


        #line default
        #line hidden

        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            }
            this.Write(Utilities.Instance.GenerateResourceAttributes(domainClass, GeneratedResourceName));
            this.Write(Utilities.Instance.GenerateDebuggerDisplayAttribute(domainClass));


        #line default
        #line hidden

        #line 51 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("[DslModeling::DomainObjectId(\"");


        #line default
        #line hidden

        #line 52 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.Id.ToString("D")));


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 53 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(domainClass.AccessModifier)));


        #line default
        #line hidden

        #line 53 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetGenerationInheritanceModifier(domainClass)));


        #line default
        #line hidden

        #line 53 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(" partial class ");


        #line default
        #line hidden

        #line 53 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetGenerationClassName(domainClass)));


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 53 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            if (domainClass.IsDomainModel)
            {
        #line default
        #line hidden

        #line 53 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write(", DslEditorModeling::IParentModelElement  ");


        #line default
        #line hidden

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

        #line default
        #line hidden

        #line 53 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(" \r\n{\r\n\t#region Constructors, domain class Id\r\n\r\n\t/// <summary>\r\n\t/// ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 58 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(" domain class Id.\r\n\t/// </summary>\r\n\tpublic static readonly new global::System.Gu" +
                       "id DomainClassId = new System.Guid(\"");


        #line default
        #line hidden

        #line 60 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.Id.ToString("D")));


        #line default
        #line hidden

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


        #line default
        #line hidden

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

            PushIndent("\t");
            GenerateDomainClassConstructors(domainClass, true);
            PopIndent();


        #line default
        #line hidden

        #line 65 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\t#endregion\r\n");


        #line default
        #line hidden

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

            PushIndent("\t");
            DomainProperty nameProperty = null;
            foreach (DomainProperty property in domainClass.Properties)
            {
                this.Write(DomainPropertyGenerator.Instance.GenerateDomainProperty(property));

                if (property.IsElementName)
                {
                    nameProperty = property;
                }
            }

            foreach (DomainRole role in domainClass.RolesPlayed)
            {
                this.Write(DomainRoleGenerator.Instance.GenerateOppositeRoleAccessor(role));
            }

            this.Write(MergeGenerator.Instance.GenerateModelMergeMembers(domainClass));

            PopIndent();

            if (domainClass.IsDomainModel)
            {
        #line default
        #line hidden

        #line 89 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\t#region DomainFilePath\r\n\t/// <summary>\r\n\t/// Gets or sets the domain file path.\r" +
                           "\n\t/// </summary>\r\n\tpublic string DomainFilePath{ get; set; }\r\n\t#endregion\r\n");


        #line default
        #line hidden

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

            string domainModelType = domainClass.GetMetaModel().GetFullName(true) + "DomainModel";
            string modifier        = "override ";


        #line default
        #line hidden

        #line 101 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\t#region IDomainModelOwnable\r\n\t/*\r\n \t/// <summary>\r\n    /// Gets the document dat" +
                       "a\r\n    /// </summary>\r\n    public override DslEditorModeling::ModelData Document" +
                       "Data\r\n    {\r\n        get\r\n\t\t{\r\n");


        #line default
        #line hidden

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

            if (this.EditorType == GenerationEditorType.VSPlugin)
            {
        #line default
        #line hidden

        #line 114 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\t\t\t// Null because in the visual studio plugin environment there can be multiple " +
                           "model datas present at once. Therefore there\r\n\t\t\t// is no singleton accessor for" +
                           " the model data.\r\n\t\t\treturn null;\r\n");


        #line default
        #line hidden

        #line 118 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            }
            else
            {
        #line default
        #line hidden

        #line 122 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\t\t\treturn ");


        #line default
        #line hidden

        #line 123 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetMetaModel().GetFullName(true)));


        #line default
        #line hidden

        #line 123 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("DocumentData.Instance;\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 126 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\t\t}\r\n    }*/\r\n\t\t\r\n\t/// <summary>\r\n    /// Gets the domain model type.\r\n    /// </" +
                       "summary>\r\n    /// <returns>Domain model type.</returns>\r\n    public ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 134 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("System.Type GetDomainModelType()\r\n\t{\r\n\t\treturn typeof(");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 136 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(");\r\n\t}\r\n\r\n    /// <summary>\r\n    /// Gets the domain model services.\r\n    /// </s" +
                       "ummary>\r\n    /// <returns>Domain model services.</returns>\r\n    public ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 143 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("DslEditorModeling::IDomainModelServices GetDomainModelServices()\r\n\t{\r\n\t\treturn ");


        #line default
        #line hidden

        #line 145 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(this.MetaModel.GetFullName(true)));


        #line default
        #line hidden

        #line 145 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("DomainModelServices.Instance;\r\n\t}\r\n\t\r\n    /// <summary>\r\n    /// Gets the domain " +
                       "model DomainClassId.\r\n    /// </summary>\r\n    /// <returns></returns>\r\n    publi" +
                       "c ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 152 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("System.Guid GetDomainModelTypeId()\r\n\t{\r\n\t\treturn ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 154 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(".DomainModelId;\r\n\t}\t\r\n\r\n    /// <summary>\r\n    /// Gets or sets the value of the " +
                       "property (which is marked as element name)\r\n    /// </summary>\r\n    public ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 160 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("string DomainElementName\r\n\t{\r\n\t\tget\r\n\t\t{\r\n");


        #line default
        #line hidden

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

            if (nameProperty != null)
            {
        #line default
        #line hidden

        #line 167 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\t\t\treturn this.");


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 169 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            }
            else
            {
                if (domainClass.BaseClass != null)
                {
        #line default
        #line hidden

        #line 175 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("\t\t\treturn base.DomainElementName;\r\n");


        #line default
        #line hidden

        #line 177 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                }
                else
                {
        #line default
        #line hidden

        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("\t\t\treturn null;\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\t\t}\r\n\t\tset\r\n\t\t{\r\n");


        #line default
        #line hidden

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

            if (nameProperty != null)
            {
        #line default
        #line hidden

        #line 193 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\t\t\tthis.");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 194 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write(" = value;\r\n");


        #line default
        #line hidden

        #line 195 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            }
            else
            {
                if (domainClass.BaseClass != null)
                {
        #line default
        #line hidden

        #line 201 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("\t\t\tbase.DomainElementName = value;\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 206 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\t\t}\r\n\t}\r\n\t\r\n    /// <summary>\r\n    /// Gets whether the domain element has a prop" +
                       "erty marked as element name.\r\n    /// </summary>\r\n    public ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 213 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("bool DomainElementHasName \r\n    {\r\n\t\tget\r\n\t\t{\r\n");


        #line default
        #line hidden

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

            if (nameProperty != null)
            {
        #line default
        #line hidden

        #line 220 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\t\t\treturn true;\r\n");


        #line default
        #line hidden

        #line 222 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            }
            else
            {
                if (domainClass.BaseClass != null)
                {
        #line default
        #line hidden

        #line 228 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("\t\t\treturn base.DomainElementHasName;\r\n");


        #line default
        #line hidden

        #line 230 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                }
                else
                {
        #line default
        #line hidden

        #line 234 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("\t\t\treturn false;\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 239 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\t\t}\r\n    }\t\r\n\t\r\n    /// <summary>\r\n    /// Gets the domain element name info if t" +
                       "here is one; Null otherwise.\r\n    /// </summary>\r\n    public ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 246 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("DslModeling::DomainPropertyInfo DomainElementNameInfo\r\n    {\r\n\t\tget\r\n\t\t{\r\n");


        #line default
        #line hidden

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

            if (nameProperty != null)
            {
        #line default
        #line hidden

        #line 253 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\t\t\treturn this.Store.DomainDataDirectory.GetDomainProperty(");


        #line default
        #line hidden

        #line 254 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetFullName(true)));


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 255 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            }
            else
            {
                if (domainClass.BaseClass != null)
                {
        #line default
        #line hidden

        #line 261 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("\t\t\treturn base.DomainElementNameInfo;\r\n");


        #line default
        #line hidden

        #line 263 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                }
                else
                {
        #line default
        #line hidden

        #line 267 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("\t\t\treturn null;\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 273 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\t\t}\r\n    }\r\n\t\r\n\t/// <summary>\r\n    /// Gets the type of the ModelElement as strin" +
                       "g.\r\n    /// </summary>\r\n    public ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 280 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("string DomainElementType\r\n    {\r\n        get\r\n        {\r\n            return \"");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 284 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\";\r\n        }\r\n    }\r\n\r\n    /// <summary>\r\n    /// Gets the display name of the t" +
                       "ype of the ModelElement.\r\n    /// </summary>\r\n    public ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 291 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("string DomainElementTypeDisplayName\r\n    {\r\n        get\r\n        {\r\n            r" +
                       "eturn \"");


        #line default
        #line hidden

        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.DisplayName));


        #line default
        #line hidden

        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write("\";\r\n        }\r\n    }\t\t\r\n\t#endregion\r\n\r\n\t/// <summary>\r\n    /// Gets the domain cl" +
                       "ass Id of this element.\r\n    /// </summary>\r\n    /// <returns>DomainClass Id.</r" +
                       "eturns>\r\n    public override System.Guid GetDomainClassId()\r\n    {\r\n        retu" +
                       "rn ");


        #line default
        #line hidden

        #line 306 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetFullName(true)));


        #line default
        #line hidden

        #line 306 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            this.Write(".DomainClassId;\r\n    }\r\n}\r\n");


        #line default
        #line hidden

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

            // If this class is double-derived, generate the skeleton derived class (with just the
            // constructors)
            if (domainClass.GeneratesDoubleDerived)
            {
                this.Write(Utilities.Instance.GenerateSummary("DomainClass", domainClass, false));
                if (inheritanceDepth > 5)
                {
        #line default
        #line hidden

        #line 317 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                    this.Write("[global::System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Maintainabili" +
                               "ty\", \"CA1501:AvoidExcessiveInheritance\", Justification = \"Generated code.\")]\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 322 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(domainClass.AccessModifier)));


        #line default
        #line hidden

        #line 322 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetInheritanceModifier(domainClass.InheritanceModifier)));


        #line default
        #line hidden

        #line 322 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write(" partial class ");


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 322 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetGenerationClassName(domainClass)));


        #line default
        #line hidden

        #line 322 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\r\n{\r\n\t#region Constructors\r\n");


        #line default
        #line hidden

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

                PushIndent("\t");
                GenerateDomainClassConstructors(domainClass, false);
                PopIndent();


        #line default
        #line hidden

        #line 329 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
                this.Write("\t#endregion\r\n}\r\n");


        #line default
        #line hidden

        #line 332 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            }
            if (!string.IsNullOrEmpty(namespaceString))
            {
                PopIndent();


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 339 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassGenerator.tt"
            }
        }
Exemple #2
0
        public void GenerateShapes(LibraryModelContext modelContext)
        {
            foreach (DiagramClass diagram in modelContext.DiagramClasses)
            {
                Dictionary <ShapeClass, List <ShapeClass> >             childParentMapping          = new Dictionary <ShapeClass, List <ShapeClass> >();
                Dictionary <DomainClass, List <EmbeddingRelationship> > embeddingChildParentMapping = new Dictionary <DomainClass, List <EmbeddingRelationship> >();

                foreach (PresentationElementClass presentationElement in diagram.PresentationElements)
                {
                    if (presentationElement is ShapeClass)
                    {
                        ShapeClass  shapeClass  = presentationElement as ShapeClass;
                        DomainClass domainClass = shapeClass.DomainClass;

                        if (domainClass == null)
                        {
                            continue;
                        }

                        if (shapeClass.Parent != null)
                        {
                            if (shapeClass.Parent.DomainClass == null)
                            {
                                continue;
                            }

                            if (!childParentMapping.ContainsKey(shapeClass.Parent))
                            {
                                childParentMapping.Add(shapeClass.Parent, new List <ShapeClass>());
                            }

                            childParentMapping[shapeClass.Parent].Add(shapeClass);
                        }

                        if (!embeddingChildParentMapping.ContainsKey(domainClass))
                        {
                            embeddingChildParentMapping.Add(domainClass, new List <EmbeddingRelationship>());
                        }
                        foreach (DomainRole rolesPlayed in domainClass.RolesPlayed)
                        {
                            if (rolesPlayed.Relationship.Target == rolesPlayed &&
                                rolesPlayed.Relationship is EmbeddingRelationship &&
                                rolesPlayed.Relationship.InheritanceModifier != InheritanceModifier.Abstract)
                            {
                                if (!embeddingChildParentMapping[domainClass].Contains(rolesPlayed.Relationship as EmbeddingRelationship))
                                {
                                    embeddingChildParentMapping[domainClass].Add(rolesPlayed.Relationship as EmbeddingRelationship);
                                }
                            }
                        }
                        if (embeddingChildParentMapping[domainClass].Count > 0)
                        {
                            IEnumerable <AttributedDomainElement> sortedByInheritanceRS = CodeGenerationUtilities.SortDomainClassesByInheritance(embeddingChildParentMapping[domainClass]);
                            embeddingChildParentMapping[domainClass].Clear();
                            foreach (EmbeddingRelationship r in sortedByInheritanceRS)
                            {
                                embeddingChildParentMapping[domainClass].Add(r);
                            }
                        }
                    }
                }
                foreach (PresentationElementClass presentationElement in diagram.PresentationElements)
                {
                    string baseClass             = "DslEditorDiagrams::NodeShape";
                    string className             = presentationElement.Name;
                    bool   hasBaseClass          = false;
                    InheritanceModifier modifier = presentationElement.InheritanceModifier;

                    if (!(presentationElement is ShapeClass))
                    {
                        baseClass = "DslEditorDiagrams::LinkShape";
                    }
                    else if (presentationElement is ShapeClass)
                    {
                        if ((presentationElement as ShapeClass).BaseShape != null)
                        {
                            ShapeClass s = (presentationElement as ShapeClass).BaseShape;
                            baseClass    = s.Namespace + "." + s.Name;
                            hasBaseClass = true;
                        }
                    }

                    if (presentationElement.GeneratesDoubleDerived)
                    {
                        className += "Base";
                        modifier   = InheritanceModifier.Abstract;
                    }



        #line default
        #line hidden

        #line 96 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write("namespace ");


        #line default
        #line hidden

        #line 97 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(presentationElement.Namespace));


        #line default
        #line hidden

        #line 97 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write("\r\n{\r\n\t/// <summary>\r\n    /// ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 100 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write(" class representing a Shape.\r\n    /// </summary>\r\n\t[DslModeling::DomainObjectId(\"" +
                               "");


        #line default
        #line hidden

        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(presentationElement.Id.ToString("D")));


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 103 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(presentationElement.AccessModifier)));


        #line default
        #line hidden

        #line 103 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetInheritanceModifier(modifier)));


        #line default
        #line hidden

        #line 103 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write(" partial class ");


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 103 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write("\r\n\t{\r\n\t\t#region Constructors, domain class Id\r\n\r\n\t\t/// <summary>\r\n\t\t/// ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 108 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write(" domain class Id.\r\n\t\t/// </summary>\r\n\t\tpublic static readonly new global::System." +
                               "Guid DomainClassId = new System.Guid(\"");


        #line default
        #line hidden

        #line 110 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(presentationElement.Id.ToString("D")));


        #line default
        #line hidden

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


        #line default
        #line hidden

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

                    PushIndent("\t\t");
                    GenerateDomainClassConstructors(presentationElement, true);
                    PopIndent();


        #line default
        #line hidden

        #line 115 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write("\t\t#endregion\r\n");


        #line default
        #line hidden

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

                    PushIndent("\t\t");
                    foreach (DomainProperty property in presentationElement.Properties)
                    {
                        this.Write(DomainPropertyGenerator.Instance.GenerateDomainProperty(property));
                    }
                    PopIndent();

                    if (presentationElement is ShapeClass)
                    {
                        ShapeClass shapeClass = presentationElement as ShapeClass;
                        bool       bTopMost   = false;
                        if (shapeClass.Parent == null)
                        {
                            bTopMost = true;
                        }


        #line default
        #line hidden

        #line 131 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write("\t\t#region Shape Properties/Methods\r\n\t\t        /// <summary>\r\n        /// Gets if " +
                                   "this shape is a top most item.\r\n        /// </summary>\r\n        public override " +
                                   "bool IsTopMostItem \r\n\t\t{ \r\n\t\t\tget\r\n\t\t\t{\r\n\t\t\t\treturn ");


        #line default
        #line hidden

        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(bTopMost.ToString().ToLower()));


        #line default
        #line hidden

        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(@";
			}
		}
		
		        /// <summary>
        /// Gets the default size of the shape.
        /// </summary>
        public override DslEditorDiagrams::SizeD DefaultSize
        {
            get
            {
                return new DslEditorDiagrams::SizeD(");


        #line default
        #line hidden

        #line 151 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.DefaultWidth));


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 151 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.DefaultHeight));


        #line default
        #line hidden

        #line 151 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(@");
            }
        }
		
		 /// <summary>
        /// Gets the used defined resizing behaviour value.
        /// </summary>
        /// <returns>Resizing behaviour value.</returns>
        public override DslEditorDiagrams::ShapeResizingBehaviour GetResizingBehaviourValue()
		{
");


        #line default
        #line hidden

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

                        if (shapeClass.IsFixedWidth && shapeClass.IsFixedHeight)
                        {
        #line default
        #line hidden

        #line 164 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                            this.Write("\t\t\treturn DslEditorDiagrams::ShapeResizingBehaviour.Fixed;\r\n");


        #line default
        #line hidden

        #line 166 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        }
                        else if (shapeClass.IsFixedWidth)
                        {
        #line default
        #line hidden

        #line 170 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                            this.Write("\t\t\treturn DslEditorDiagrams::ShapeResizingBehaviour.FixedWidth;\r\n");


        #line default
        #line hidden

        #line 172 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        }
                        else if (shapeClass.IsFixedHeight)
                        {
        #line default
        #line hidden

        #line 176 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                            this.Write("\t\t\treturn DslEditorDiagrams::ShapeResizingBehaviour.FixedHeight;\r\n");


        #line default
        #line hidden

        #line 178 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        }
                        else
                        {
        #line default
        #line hidden

        #line 182 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                            this.Write("\t\t\treturn DslEditorDiagrams::ShapeResizingBehaviour.Normal;\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(@"		}

        /// <summary>
        /// Gets the used defined movement behaviour value.
        /// </summary>
        /// <returns>Movement behaviour value.</returns>
        public override DslEditorDiagrams::ShapeMovementBehaviour GetMovementBehaviourValue()
		{
");


        #line default
        #line hidden

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

                        if (shapeClass.IsRelativeChild)
                        {
                            if (shapeClass.RelativeChildBehaviour == RelativeChildBehaviour.PositionRelativeToParent)
                            {
        #line default
        #line hidden

        #line 200 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                                this.Write("\t\t\treturn DslEditorDiagrams::ShapeMovementBehaviour.PositionRelativeToParent;\r\n");


        #line default
        #line hidden

        #line 202 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                            }
                            else if (shapeClass.RelativeChildBehaviour == RelativeChildBehaviour.PositionOnEdgeOfParent)
                            {
        #line default
        #line hidden

        #line 206 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                                this.Write("\t\t\treturn DslEditorDiagrams::ShapeMovementBehaviour.PositionOnEdgeOfParent;\r\n");


        #line default
        #line hidden

        #line 208 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                            }
                        }
                        else
                        {
        #line default
        #line hidden

        #line 213 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                            this.Write("\t\t\treturn DslEditorDiagrams::ShapeMovementBehaviour.Normal;\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 217 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(@"		}

        /// <summary>
        /// Gets whether this shape is a relative child shape or not.
        /// </summary>
        /// <returns>True if this shape is a relative child shape. False otherwise</returns>
        public override bool GetIsRelativeChildShapeValue()
		{
			return "            );


        #line default
        #line hidden

        #line 226 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.IsRelativeChild.ToString().ToLower()));


        #line default
        #line hidden

        #line 226 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(@";
		}
		
        /// <summary>
        /// Gets whether this shape takes part in any relationship or not.
        /// </summary>
        /// <returns>True if this shape takes part in any relationship. False otherwise</returns>
        public override bool GetTakesPartInRelationshipValue()
		{
");


        #line default
        #line hidden

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

                        if (hasBaseClass)
                        {
        #line default
        #line hidden

        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                            this.Write("\t\t\tif( base.GetTakesPartInRelationshipValue() )\r\n\t\t\t\treturn true;\r\n\t\t\t\t\r\n");


        #line default
        #line hidden

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

                        bool takesPart = false;
                        foreach (PresentationElementClass pLink in diagram.PresentationElements)
                        {
                            if (pLink is RelationshipShapeClass)
                            {
                                RelationshipShapeClass rsShape = pLink as RelationshipShapeClass;
                                DomainRelationship     con     = rsShape.ReferenceRelationship;
                                if (con != null)
                                {
                                    if (CodeGenerationUtilities.ShapeTakesPart(shapeClass, con))
                                    {
                                        takesPart = true;
                                    }
                                }
                            }
                            else if (!takesPart && pLink is MappingRelationshipShapeClass)
                            {
                                MappingRelationshipShapeClass rsShape = pLink as MappingRelationshipShapeClass;
                                ReferenceRelationship         con     = rsShape.Source;
                                if (con != null)
                                {
                                    if (CodeGenerationUtilities.ShapeTakesPart(shapeClass, con.Target.RolePlayer as DomainClass))
                                    {
                                        takesPart = true;
                                    }
                                }

                                con = rsShape.Target;
                                if (con != null && !takesPart)
                                {
                                    if (CodeGenerationUtilities.ShapeTakesPart(shapeClass, con.Target.RolePlayer as DomainClass))
                                    {
                                        takesPart = true;
                                    }
                                }
                            }
                        }


        #line default
        #line hidden

        #line 270 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write("\t\t\treturn ");


        #line default
        #line hidden

        #line 271 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(takesPart.ToString().ToLower()));


        #line default
        #line hidden

        #line 271 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(";\r\n\t\t}\r\n\t\t#endregion\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                    this.Write("\t}\r\n");


        #line default
        #line hidden

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

                    // If this class is double-derived, generate the skeleton derived class (with just the
                    // constructors)
                    if (presentationElement.GeneratesDoubleDerived)
                    {
        #line default
        #line hidden

        #line 283 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write("\t\t\t\r\n\t/// <summary>\r\n    /// ");


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 285 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(" class representing a Shape.\r\n    /// </summary>\r\n\t");


        #line default
        #line hidden

        #line 287 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(presentationElement.AccessModifier)));


        #line default
        #line hidden

        #line 287 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetInheritanceModifier(presentationElement.InheritanceModifier)));


        #line default
        #line hidden

        #line 287 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write(" partial class ");


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

        #line 287 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write("Base\r\n\t{\r\n\t\t#region Constructors\r\n");


        #line default
        #line hidden

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

                        PushIndent("\t\t");
                        GenerateDomainClassConstructors(presentationElement, false);
                        PopIndent();


        #line default
        #line hidden

        #line 294 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ShapesGenerator.tt"
                        this.Write("\t\t#endregion\r\n\t}\r\n");


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

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


        #line default
        #line hidden

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