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" } }
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" } }