public static string GetServiceRegistrarFullName(MetaModel dm)
 {
     string fullName = dm.Namespace + ".ViewModel.";
     fullName += dm.Name + "ServiceRegistrar";
     return fullName;
 }
public string GenerateRibbon(MetaModel dm)
{
	this.GenerationEnvironment = null;
	this.GenerateRibbonInternal(dm);
	return this.GenerationEnvironment.ToString();
}
public void GenerateViewModelData(MetaModel dm)
{
	List<AttributedDomainElement> allDomainElementsUnsorted = new List<AttributedDomainElement>();
	allDomainElementsUnsorted.AddRange(dm.AllClasses);
	allDomainElementsUnsorted.AddRange(dm.AllRelationships);
	IEnumerable allDomainElements = CodeGenerationUtilities.SortDomainClassesByInheritance(allDomainElementsUnsorted);	
	
	bool bFirstIf = true;

        
        #line default
        #line hidden
        
        #line 34 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("namespace ");

        
        #line default
        #line hidden
        
        #line 35 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

        
        #line default
        #line hidden
        
        #line 35 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel\r\n{\r\n\t/// <summary>\r\n\t/// This class represents the view model store of" +
        " ");

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.ApplicationName));

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".\r\n\t/// \r\n\t/// Double-derived class to allow easier code customization.\r\n\t/// </s" +
        "ummary>\r\n\tpublic partial class ");

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelStore : ");

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelStoreBase\r\n\t{\r\n\t\t#region Constructor\r\n\t\t/// <summary>\r\n        /// Const" +
        "ructor.\r\n        /// </summary>\r\n        /// <param name=\"modelData\">Document da" +
        "ta.</param>\r\n        public ");

        
        #line default
        #line hidden
        
        #line 49 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 49 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelStore(DslEditorModeling::ModelData modelData)\r\n            : this(modelD" +
        "ata, true)\r\n        {\r\n\r\n        }\r\n\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 55 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		if( dm.LanguageType == LanguageType.WPFEditor || dm.LanguageType == LanguageType.VMXEditor)
		{

        
        #line default
        #line hidden
        
        #line 58 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\r\n\t\t/// <summary>\r\n        /// Constructor.\r\n        /// </summary>\r\n        ///" +
        " <param name=\"modelData\">Document data.</param>\r\n        /// <param name=\"option" +
        "s\">Options.</param>\r\n        public ");

        
        #line default
        #line hidden
        
        #line 64 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 64 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelStore(DslEditorModeling::ModelData modelData, Tum.PDE.ToolFramework.Mode" +
        "ling.Visualization.Base.ViewModelOptions options)\r\n            : base(modelData," +
        " options)\r\n        {\r\n\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 68 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 70 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\r\n\t\t/// <summary>\r\n        /// Constructor.\r\n        /// </summary>\r\n        //" +
        "/ <param name=\"modelData\">Document data.</param>\r\n\t\t/// <param name=\"bHookUpEven" +
        "ts\">True if events listeners should be initialized.</param>\r\n        public ");

        
        #line default
        #line hidden
        
        #line 77 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 77 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"ViewModelStore(DslEditorModeling::ModelData modelData, bool bHookUpEvents)
            : this(modelData, bHookUpEvents, null)
        {

        }		
		
		/// <summary>
        /// Constructor.
        /// </summary>
        /// <param name=""modelData"">Document data.</param>
		/// <param name=""bHookUpEvents"">True if events listeners should be initialized.</param>
		/// <param name=""ownedByStore"">Store owning this store.</param>
        public ");

        
        #line default
        #line hidden
        
        #line 89 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 89 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"ViewModelStore(DslEditorModeling::ModelData modelData, bool bHookUpEvents, DslEditorViewModelData::ViewModelStore ownedByStore)
            : base(modelData, bHookUpEvents, ownedByStore)
        {
        }			
		#endregion
	}
	
	/// <summary>
	/// This class represents the view model store of ");

        
        #line default
        #line hidden
        
        #line 97 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.ApplicationName));

        
        #line default
        #line hidden
        
        #line 97 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".\r\n\t/// \r\n\t/// This is the abstract base class.\r\n\t/// </summary>\r\n\tpublic abstrac" +
        "t class ");

        
        #line default
        #line hidden
        
        #line 101 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 101 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelStoreBase : DslEditorViewModelData::ViewModelStore\r\n\t{\r\n\t\t#region Constr" +
        "uctor\r\n");

        
        #line default
        #line hidden
        
        #line 104 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		if( dm.LanguageType == LanguageType.WPFEditor || dm.LanguageType == LanguageType.VMXEditor)
		{

        
        #line default
        #line hidden
        
        #line 107 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"			
		/// <summary>
        /// Constuctor.
        /// </summary>
        /// <param name=""modelData"">Document data.</param>
		/// <param name=""bHookUpEvents"">True if events listeners should be initialized.</param>
		/// <param name=""options"">Options.</param>
        protected ");

        
        #line default
        #line hidden
        
        #line 114 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 114 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"ViewModelStoreBase(DslEditorModeling::ModelData modelData, Tum.PDE.ToolFramework.Modeling.Visualization.Base.ViewModelOptions options)
            : base(modelData, true, null)
        {
			this.Options = options;
			if( this.Options == null )
				this.Options = new ");

        
        #line default
        #line hidden
        
        #line 119 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 119 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelOptions();\r\n        }\r\n");

        
        #line default
        #line hidden
        
        #line 121 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 123 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\t\r\n\t\t\r\n\t\t/// <summary>\r\n        /// Constuctor.\r\n        /// </summary>\r\n      " +
        "  /// <param name=\"modelData\">Document data.</param>\r\n\t\t/// <param name=\"bHookUp" +
        "Events\">True if events listeners should be initialized.</param>\r\n        protect" +
        "ed ");

        
        #line default
        #line hidden
        
        #line 130 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 130 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"ViewModelStoreBase(DslEditorModeling::ModelData modelData, bool bHookUpEvents)
            : this(modelData, bHookUpEvents, null)
        {
        }		
		
		/// <summary>
        /// Constuctor.
        /// </summary>
        /// <param name=""modelData"">Document data.</param>
		/// <param name=""bHookUpEvents"">True if events listeners should be initialized.</param>
		/// <param name=""ownedByStore"">Store owning this store.</param>
        protected ");

        
        #line default
        #line hidden
        
        #line 141 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 141 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelStoreBase(DslEditorModeling::ModelData modelData, bool bHookUpEvents, Ds" +
        "lEditorViewModelData::ViewModelStore ownedByStore)\r\n            : base(modelData" +
        ", bHookUpEvents, ownedByStore)\r\n        {\r\n");

        
        #line default
        #line hidden
        
        #line 144 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		if( dm.LanguageType == LanguageType.WPFEditor || dm.LanguageType == LanguageType.VMXEditor)
		{

        
        #line default
        #line hidden
        
        #line 147 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\t\r\n\t\t\tthis.Options = new ");

        
        #line default
        #line hidden
        
        #line 148 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 148 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelOptions();\r\n");

        
        #line default
        #line hidden
        
        #line 149 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 151 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"			
        }		
		#endregion
		
		#region Initialization
        private DslEditorViewModelData::ViewModelStore GetExternViewModelStore(DslEditorViewModelData::ViewModelStore st, System.Type type)
        {
            foreach (DslEditorViewModelData::ViewModelStore s in st.ExternStores)
                if( s.GetType() == type )
                    return s;

            return null;
        }
		
        /// <summary>
        /// Register extern stores.
        /// </summary>
        protected override void RegisterExternStores()
		{
");

        
        #line default
        #line hidden
        
        #line 170 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		int counter = 0;
		foreach(MetaModelLibrary lib in dm.MetaModelLibraries)
		{
			if( lib.ImportedLibrary == null )
				continue;
			
			MetaModel m = (lib.ImportedLibrary as MetaModel);

        
        #line default
        #line hidden
        
        #line 178 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\tDslEditorViewModelData::ViewModelStore v");

        
        #line default
        #line hidden
        
        #line 179 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(counter));

        
        #line default
        #line hidden
        
        #line 179 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(" = GetExternViewModelStore(this.TopMostStore, typeof(");

        
        #line default
        #line hidden
        
        #line 179 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(m.Namespace));

        
        #line default
        #line hidden
        
        #line 179 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel.");

        
        #line default
        #line hidden
        
        #line 179 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(m.Name));

        
        #line default
        #line hidden
        
        #line 179 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelStore));\r\n\t\t\tif( v");

        
        #line default
        #line hidden
        
        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(counter));

        
        #line default
        #line hidden
        
        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(" == null )\r\n\t\t\t\tv");

        
        #line default
        #line hidden
        
        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(counter));

        
        #line default
        #line hidden
        
        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(" = new ");

        
        #line default
        #line hidden
        
        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(m.Namespace));

        
        #line default
        #line hidden
        
        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel.");

        
        #line default
        #line hidden
        
        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(m.Name));

        
        #line default
        #line hidden
        
        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelStore(this.ModelData, true, this);\r\n\t\t\tthis.ExternStores.Add(v");

        
        #line default
        #line hidden
        
        #line 182 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(counter));

        
        #line default
        #line hidden
        
        #line 182 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(");\r\n\t\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 184 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

			counter++;
		}

        
        #line default
        #line hidden
        
        #line 187 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"		}
		
        /// <summary>
        /// Gets the view model factory which provides methods for the creation of view models for model elements from the model.
        /// </summary>
        public override DslEditorViewModelData::ViewModelFactory Factory 
		{ 
			get
			{
				return new ");

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"ViewModelFactory(this);
			}
		}
		#endregion
		
		#region Methods
		/// <summary>
        /// Called to load options when the application starts.
        /// </summary>
        public override void LoadOptions(DslEditorViewModelServices::IMessageBoxService messageBox)
        {
");

        
        #line default
        #line hidden
        
        #line 208 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		if( dm.LanguageType == LanguageType.WPFEditor || dm.LanguageType == LanguageType.VMXEditor)
		{

        
        #line default
        #line hidden
        
        #line 211 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\tthis.Options = new ");

        
        #line default
        #line hidden
        
        #line 212 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 212 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelOptions();\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n            \tstring directory = this.Mode" +
        "lData.GetDomainModelServices().ModelDataOptions.AppDataDirectory;\r\n\t\t\t\tstring pa" +
        "th = directory + System.IO.Path.DirectorySeparatorChar + ");

        
        #line default
        #line hidden
        
        #line 217 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 217 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelOptions.OptionsFileName;\r\n\t\t\t\tthis.Options.Deserialize(path);\r\n\t\t\t}\r\n\t\t\t" +
        "catch(System.Exception ex)\r\n\t\t\t{\r\n\t\t\t\tmessageBox.ShowError(\"Couldn\'t open option" +
        "s: \" + ex.Message);\r\n\t\t\t\t\r\n\t\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 227 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t}\r\n\t\t\r\n        /// <summary>\r\n        /// Called to save options when the appli" +
        "cation exits.\r\n        /// </summary>\r\n        public override void SaveOptions(" +
        "DslEditorViewModelServices::IMessageBoxService messageBox)\r\n        {\r\n");

        
        #line default
        #line hidden
        
        #line 235 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		if( dm.LanguageType == LanguageType.WPFEditor || dm.LanguageType == LanguageType.VMXEditor)
		{

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\r\n\t\t\t// save options\r\n\t\t\ttry\r\n\t\t\t{\r\n            \tstring directory = this.ModelD" +
        "ata.GetDomainModelServices().ModelDataOptions.AppDataDirectory;\r\n\t\t\t\tstring path" +
        " = directory + System.IO.Path.DirectorySeparatorChar + ");

        
        #line default
        #line hidden
        
        #line 243 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 243 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelOptions.OptionsFileName;\r\n\t\t\t\tthis.Options.Serialize(path);\r\n\t\t\t}\r\n\t\t\tca" +
        "tch(System.Exception ex)\r\n\t\t\t{\r\n\t\t\t\tmessageBox.ShowError(\"Couldn\'t save options:" +
        " \" + ex.Message);\r\n\t\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 250 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 252 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\r\n\t\t}\r\n\t\t#endregion\r\n\t}\r\n\t\r\n\t/// <summary>\r\n\t/// This class represents the view" +
        " model factory of ");

        
        #line default
        #line hidden
        
        #line 258 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.ApplicationName));

        
        #line default
        #line hidden
        
        #line 258 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".\r\n\t/// \r\n\t/// Double-derived class to allow easier code customization.\r\n\t/// </s" +
        "ummary>\r\n\tpublic partial class ");

        
        #line default
        #line hidden
        
        #line 262 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 262 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelFactory : ");

        
        #line default
        #line hidden
        
        #line 262 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 262 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelFactoryBase\r\n\t{\r\n\t\t#region Constructor\r\n\t\t/// <summary>\r\n        /// Con" +
        "stuctor.\r\n        /// </summary>\r\n        /// <param name=\"viewModelStore\">View " +
        "model store.</param>\r\n        public ");

        
        #line default
        #line hidden
        
        #line 269 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 269 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelFactory(DslEditorViewModelData::ViewModelStore viewModelStore)\r\n        " +
        "    : base(viewModelStore)\r\n        {\r\n        }\r\n\t\t#endregion\r\n\t}\r\n\t\r\n\t/// <sum" +
        "mary>\r\n\t/// This class represents the view model factory of ");

        
        #line default
        #line hidden
        
        #line 277 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.ApplicationName));

        
        #line default
        #line hidden
        
        #line 277 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".\r\n\t/// \r\n\t/// This is the abstract base class.\r\n\t/// </summary>\r\n\tpublic abstrac" +
        "t class ");

        
        #line default
        #line hidden
        
        #line 281 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 281 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModelFactoryBase : DslEditorViewModelData::ViewModelFactory\r\n\t{\r\n\t\t#region Co" +
        "nstructor\r\n\t\t/// <summary>\r\n        /// Constuctor.\r\n        /// </summary>\r\n   " +
        "     /// <param name=\"viewModelStore\">View model store.</param>\r\n        public " +
        "");

        
        #line default
        #line hidden
        
        #line 288 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 288 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"ViewModelFactoryBase(DslEditorViewModelData::ViewModelStore viewModelStore)
            : base(viewModelStore)
        {
        }
		#endregion
		
		#region Methods
		
		#region CreateDiagramLinkViewModel
	    /// <summary>
        /// Creates the view model for the given link shape.
        /// </summary>
        /// <param name=""nodeShapeType"">Shape type for which the view model is to be created.</param>
        /// <param name=""diagram"">Diagram surface vm.</param>
        /// <param name=""nodeShape"">Link shape.</param>
        /// <returns>
        /// View model of type BaseDiagramItemLinkViewModel if a view model can be created for the given element. Null otherwise.</returns>
        public override DslEditorViewModel.DiagramSurface.BaseDiagramItemLinkViewModel CreateDiagramLinkViewModel(System.Guid nodeShapeType, DslEditorViewDiagrams::DiagramSurfaceViewModel diagram, DslEditorDiagrams::LinkShape nodeShape)
        {
");

        
        #line default
        #line hidden
        
        #line 307 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	 	ReadOnlyCollection<RelationshipShapeClass> rShapeClasses = dm.Store.ElementDirectory.FindElements<RelationshipShapeClass>();
		foreach(RelationshipShapeClass shapeClass in rShapeClasses)
		{
			if( shapeClass.ReferenceRelationship == null )
				continue;

        
        #line default
        #line hidden
        
        #line 313 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\tif( nodeShapeType == ");

        
        #line default
        #line hidden
        
        #line 314 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 314 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".DomainClassId )\r\n\t\t\t\treturn new ");

        
        #line default
        #line hidden
        
        #line 315 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetMetaModel().Namespace));

        
        #line default
        #line hidden
        
        #line 315 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel.");

        
        #line default
        #line hidden
        
        #line 315 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Name));

        
        #line default
        #line hidden
        
        #line 315 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("DiagramItemLinkViewModel(this.Store, diagram, nodeShape);\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 317 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}
		
		ReadOnlyCollection<MappingRelationshipShapeClass> mapShapeClasses = dm.Store.ElementDirectory.FindElements<MappingRelationshipShapeClass>();
		foreach(MappingRelationshipShapeClass shapeClass in mapShapeClasses)
		{
			if( shapeClass.DomainClass == null || shapeClass.Source == null || shapeClass.Target == null)
				continue;

        
        #line default
        #line hidden
        
        #line 325 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\tif( nodeShapeType == ");

        
        #line default
        #line hidden
        
        #line 326 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 326 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".DomainClassId )\r\n\t\t\t\treturn new ");

        
        #line default
        #line hidden
        
        #line 327 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetMetaModel().Namespace));

        
        #line default
        #line hidden
        
        #line 327 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel.");

        
        #line default
        #line hidden
        
        #line 327 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Name));

        
        #line default
        #line hidden
        
        #line 327 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("DiagramItemLinkViewModel(this.Store, diagram, nodeShape);\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 329 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 331 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"
            return null;
        }

        #endregion
		
		#region CreateDiagramItemViewModel
        /// <summary>
        /// Creates the view model for the given node shape.
        /// </summary>
        /// <param name=""nodeShapeType"">Shape type for which the view model is to be created.</param>
		/// <param name=""diagram"">Diagram surface vm.</param>
		/// <param name=""nodeShape"">Node shape.</param>
        /// <returns>
        /// View model of type DiagramItemElementViewModel if a view model can be created for the given element. Null otherwise.
		/// </returns>
        public override DslEditorViewModel.DiagramSurface.DiagramItemElementViewModel CreateDiagramItemViewModel(System.Guid nodeShapeType, DslEditorViewDiagrams::DiagramSurfaceViewModel diagram, DslEditorDiagrams::NodeShape nodeShape)
        {
");

        
        #line default
        #line hidden
        
        #line 350 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	 	ReadOnlyCollection<ShapeClass> shapeClasses = dm.Store.ElementDirectory.FindElements<ShapeClass>();
		foreach(ShapeClass shapeClass in shapeClasses)
		{
			if( shapeClass.DomainClass == null )
				continue;

        
        #line default
        #line hidden
        
        #line 356 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\tif( nodeShapeType == ");

        
        #line default
        #line hidden
        
        #line 357 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 357 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".DomainClassId )\r\n\t\t\t\treturn new ");

        
        #line default
        #line hidden
        
        #line 358 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetMetaModel().Namespace));

        
        #line default
        #line hidden
        
        #line 358 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel.");

        
        #line default
        #line hidden
        
        #line 358 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Name));

        
        #line default
        #line hidden
        
        #line 358 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("DiagramItemViewModel(this.Store, diagram, nodeShape);\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 360 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 362 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\r\n            return null;\r\n        }\r\n\r\n        #endregion\r\n\t\t\r\n\t\t#region Create" +
        "ModelElementTreeViewModel\r\n\t\t/// <summary>\r\n        /// Creates the tree view mo" +
        "del for the given model element.\r\n        /// </summary>\r\n        /// <param nam" +
        "e=\"modelElement\">Model element for which the tree view model is to be created.</" +
        "param>\r\n        /// <param name=\"bHookUpEvents\">Hook up into model events to upd" +
        "ate the created view model on changes in model if true.</param>\r\n        /// <pa" +
        "ram name=\"bCreateContextMenus\">Creates context menus for adding and deleting mod" +
        "el elements if true.</param>\r\n\t\t/// <param name=\"mainModelTreeVm\">Main model tre" +
        "e view model.</param>\r\n        /// <returns>\r\n        /// View model of type Bas" +
        "eModelElementTreeViewModel if a view model can be created for the given element." +
        " Null otherwise.</returns>\r\n        /// <remarks>\r\n        /// A view model of t" +
        "he type BaseModelElementViewModel can obly be created for domain classes and ref" +
        "erencing relationships, that\r\n        /// can be embedded in the model tree.\r\n  " +
        "      /// </remarks>\r\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Micros" +
        "oft.Reliability\", \"CA2000:Dispose objects before losing scope\")]\r\n        public" +
        " override DslEditorViewModelModelTree::BaseModelElementTreeViewModel CreateModel" +
        "ElementTreeViewModel(DslModeling::ModelElement modelElement, bool bHookUpEvents," +
        " bool bCreateContextMenus, DslEditorViewModel::MainModelTreeViewModel mainModelT" +
        "reeVm)\r\n\t\t{\r\n\t\t\tif( modelElement is DslEditorModeling::IDomainModelOwnable )\r\n\t\t" +
        "\t{\r\n");

        
        #line default
        #line hidden
        
        #line 388 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	    System.Collections.ObjectModel.ReadOnlyCollection<MetaModel> col =dm.Store.ElementDirectory.FindElements<MetaModel>();
		foreach(MetaModel metaModel in col)
		{

        
        #line default
        #line hidden
        
        #line 392 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\t\tif( ");

        
        #line default
        #line hidden
        
        #line 393 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(metaModel.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 393 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("DomainModel.DomainModelId == (modelElement as DslEditorModeling::IDomainModelOwna" +
        "ble).GetDomainModelTypeId() )\r\n\t\t\t\t\treturn new ");

        
        #line default
        #line hidden
        
        #line 394 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(metaModel.Namespace));

        
        #line default
        #line hidden
        
        #line 394 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel.ModelTree.ModelTree");

        
        #line default
        #line hidden
        
        #line 394 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(metaModel.Name));

        
        #line default
        #line hidden
        
        #line 394 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModel(this.Store, modelElement, null, System.Guid.Empty, null, bHookUpEvents," +
        " bCreateContextMenus, mainModelTreeVm); \r\n");

        
        #line default
        #line hidden
        
        #line 395 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 397 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn new DslEditorViewModelModelTree::ModelElementTreeV" +
        "iewModel(this.Store, modelElement, null, System.Guid.Empty, null, bHookUpEvents," +
        " bCreateContextMenus, mainModelTreeVm);\r\n\t\t}\r\n\t\t\r\n\t\t/// <summary>\r\n        /// C" +
        "reates the tree view model for the given model element.\r\n        /// </summary>\r" +
        "\n        /// <param name=\"element\">VModell represented by this view model.</para" +
        "m>\r\n        /// <param name=\"link\">Element link, targeting the hosted element.</" +
        "param>\r\n        /// <param name=\"domainRoleId\">Domain role id of the role that t" +
        "he hosted element belongs to.</param>\r\n        /// <param name=\"parent\">Parent o" +
        "f this view model.</param>\r\n        /// <param name=\"bHookUpEvents\">Hook up into" +
        " model events to update the created view model on changes in model if true.</par" +
        "am>\r\n        /// <param name=\"bCreateContextMenus\">Creates context menus for add" +
        "ing and deleting model elements if true.</param>\r\n        /// <param name=\"mainM" +
        "odelTreeVm\">Model tree view model, this element vm belongs to.</param>\r\n\t\t[Syste" +
        "m.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Reliability\", \"CA2000:Disp" +
        "ose objects before losing scope\")]\r\n        public override DslEditorViewModelMo" +
        "delTree::ModelElementTreeViewModel CreateModelElementTreeViewModel(DslModeling::" +
        "ModelElement element, DslModeling::ElementLink link, System.Guid domainRoleId, D" +
        "slEditorViewModelModelTree::ModelElementTreeViewModel parent, bool bHookUpEvents" +
        ", bool bCreateContextMenus, DslEditorViewModel::MainModelTreeViewModel mainModel" +
        "TreeVm)\r\n\t\t{\r\n\t\t\tif( element is DslEditorModeling::IDomainModelOwnable )\r\n\t\t\t{\r\n" +
        "");

        
        #line default
        #line hidden
        
        #line 420 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	    col =dm.Store.ElementDirectory.FindElements<MetaModel>();
		foreach(MetaModel metaModel in col)
		{

        
        #line default
        #line hidden
        
        #line 424 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\t\tif( ");

        
        #line default
        #line hidden
        
        #line 425 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(metaModel.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 425 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("DomainModel.DomainModelId == (element as DslEditorModeling::IDomainModelOwnable)." +
        "GetDomainModelTypeId() )\r\n\t\t\t\t\treturn new ");

        
        #line default
        #line hidden
        
        #line 426 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(metaModel.Namespace));

        
        #line default
        #line hidden
        
        #line 426 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel.ModelTree.ModelTree");

        
        #line default
        #line hidden
        
        #line 426 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(metaModel.Name));

        
        #line default
        #line hidden
        
        #line 426 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModel(this.Store, element, link, domainRoleId, parent, bHookUpEvents, bCreate" +
        "ContextMenus, mainModelTreeVm); \r\n");

        
        #line default
        #line hidden
        
        #line 427 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 429 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\t}\r\n\t\t\t\r\n\t\t\treturn new DslEditorViewModelModelTree::ModelElementTreeViewModel(t" +
        "his.Store, element, link, domainRoleId, parent, bHookUpEvents, bCreateContextMen" +
        "us, mainModelTreeVm); \r\n\t\t}\r\n\t\t#endregion\r\n\t\t\r\n\t\t#region CreatePropertyEditorVie" +
        "wModels\r\n\t\t/// <summary>\r\n        /// Returns a collection of property grid view" +
        " models for the given selected elements.\r\n        /// </summary>\r\n        /// <p" +
        "aram name=\"elements\">Selected elements collection.</param>\r\n        /// <returns" +
        ">Collection of property view models. Can be empty.</returns>\r\n        public ove" +
        "rride System.Collections.Generic.List<DslEditorViewModelPropertyGrid::PropertyGr" +
        "idViewModel> CreatePropertyEditorViewModels(DslEditorModeling::SelectedItemsColl" +
        "ection elements)\r\n\t\t{\r\n\t\t\tSystem.Collections.Generic.List<DslEditorViewModelProp" +
        "ertyGrid::PropertyGridViewModel> collection = new System.Collections.Generic.Lis" +
        "t<DslEditorViewModelPropertyGrid::PropertyGridViewModel>();\r\n\r\n\t\t\tforeach(DslMod" +
        "eling::ModelElement modelElement in elements )\r\n\t\t\t{\r\n\t\t\t\tSystem.Collections.Gen" +
        "eric.List<DslEditorViewModelData::ViewModelStore> handledStores = new System.Col" +
        "lections.Generic.List<DslEditorViewModelData::ViewModelStore>();\r\n\t\t\t\tAddPropert" +
        "yEditorViewModels(collection, modelElement, handledStores);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tretur" +
        "n collection;\r\n\t\t}\r\n\t\t\r\n        /// <summary>\r\n        /// Returns a collection " +
        "of property view models for the given selected elements.\r\n        /// </summary>" +
        "\r\n        /// <param name=\"models\">Already gathered models.</param>\r\n        ///" +
        " <param name=\"modelElement\">ModelElement.</param>\r\n        /// <param name=\"hand" +
        "ledStores\">Stores that have already been processed.</param>\r\n        /// <return" +
        "s>Collection of property view models. Can be empty.</returns>\r\n        public ov" +
        "erride bool AddPropertyEditorViewModels(System.Collections.Generic.List<DslEdito" +
        "rViewModelPropertyGrid::PropertyGridViewModel> models, DslModeling::ModelElement" +
        " modelElement, System.Collections.Generic.List<DslEditorViewModelData::ViewModel" +
        "Store> handledStores)\r\n\t\t{\r\n\t\t\tif( handledStores.Contains(this.Store) )\r\n\t\t\t\tret" +
        "urn false;\r\n\t\t\telse \r\n\t\t\t\thandledStores.Add(this.Store);\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 469 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	bFirstIf = true;

	IEnumerable<AttributedDomainElement> domainElements = CodeGenerationUtilities.GetElementsForPropertyGridViewModelCreation(dm);
	foreach(AttributedDomainElement domainElement in domainElements)
	{
		if( domainElement.InheritanceModifier == InheritanceModifier.Abstract )
			continue;

		
		if( bFirstIf )
		{
			bFirstIf = false;

        
        #line default
        #line hidden
        
        #line 482 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\tif");

        
        #line default
        #line hidden
        
        #line 482 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}
		else
		{

        
        #line default
        #line hidden
        
        #line 486 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\telse if");

        
        #line default
        #line hidden
        
        #line 486 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 488 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("( modelElement.GetDomainClass().Id == ");

        
        #line default
        #line hidden
        
        #line 488 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 488 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".DomainClassId )\r\n\t\t\t{\r\n\t\t\t\tmodels.Add(new PropertyGrid");

        
        #line default
        #line hidden
        
        #line 490 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 490 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("ViewModel(this.Store, modelElement as ");

        
        #line default
        #line hidden
        
        #line 490 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 490 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("));\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 493 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	}
	if( domainElements.Count() > 0 )
	{

        
        #line default
        #line hidden
        
        #line 497 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach(DslEditorViewModelData::ViewModelStore eS in this.Stor" +
        "e.ExternStores)\r\n\t\t\t\t\tif( eS.Factory.AddPropertyEditorViewModels(models, modelEl" +
        "ement, handledStores) )\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 504 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	}
	else
	{

        
        #line default
        #line hidden
        
        #line 508 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\tforeach(DslEditorViewModelData::ViewModelStore eS in this.Store.ExternStores)\r\n" +
        "\t\t\tif( eS.Factory.AddPropertyEditorViewModels(models, modelElement, handledStore" +
        "s) )\r\n\t\t\t\treturn true;\r\n");

        
        #line default
        #line hidden
        
        #line 512 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	}

        
        #line default
        #line hidden
        
        #line 514 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"
			return false;
		}
		
		#endregion				
		
		#region CreateRestorableViewModel
        /// <summary>
        /// Attempts at creating a view model of a specified type. This is meant to be called for restorable VMs that are in 
        /// the process of beeing restored.
        /// </summary>
        /// <param name=""vmType"">Type of the vm.</param>
        /// <param name=""handledStores"">Stores that have already been processed.</param>
        /// <returns>VM if succeeded. Null otherwise.</returns>
        public override DslEditorViewDiagrams::BaseDiagramSurfaceViewModel CreateRestorableViewModel(string vmType, System.Collections.Generic.List<DslEditorViewModelData::ViewModelStore> handledStores)
		{
");

        
        #line default
        #line hidden
        
        #line 531 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

	foreach(DiagramClass diagramClass in this.MetaModel.AllDiagramClasses)
	{
		if( !CodeGenerationUtilities.IsDiagramGenerated(diagramClass) )
			continue;
		
		if( diagramClass is RestorableChildlessDiagram || diagramClass is RestorableTemplatedDiagramVMOnly)
		{
			MetaModel metaModel = diagramClass.DiagramClassView.DiagramView.ViewContext.ModelContext.MetaModel;
			string t = metaModel.Name+diagramClass.Name+"SurfaceViewModel";

        
        #line default
        #line hidden
        
        #line 541 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\t\t\tif( vmType == \"");

        
        #line default
        #line hidden
        
        #line 542 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(t));

        
        #line default
        #line hidden
        
        #line 542 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("\" )\r\n\t\t\t{\r\n\t\t\t\treturn new ");

        
        #line default
        #line hidden
        
        #line 544 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(metaModel.Namespace));

        
        #line default
        #line hidden
        
        #line 544 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(".ViewModel.");

        
        #line default
        #line hidden
        
        #line 544 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(t));

        
        #line default
        #line hidden
        
        #line 544 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write("(this.Store);\r\n\t\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 546 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

		}
	}

        
        #line default
        #line hidden
        
        #line 549 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"
this.Write(@"		
			foreach(DslEditorViewModelData::ViewModelStore eS in this.Store.ExternStores)
			{
				DslEditorViewDiagrams::BaseDiagramSurfaceViewModel vm = eS.Factory.CreateRestorableViewModel(vmType, handledStores);
				if( vm != null )
					return vm;
			}
			
			return null;
		}
		#endregion 
		#endregion
	}	
}
");

        
        #line default
        #line hidden
        
        #line 564 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelDataGenerator.tt"

}
public void GenerateDiagram(MetaModel dm, DiagramClass diagram)
{
	string baseClass = "DslEditorDiagrams::Diagram";
	if( diagram is DependencyDiagram )
	{
		baseClass = "DslEditorDiagrams::GraphicalDependenciesDiagram";
	}

        
        #line default
        #line hidden
        
        #line 30 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("\r\nnamespace ");

        
        #line default
        #line hidden
        
        #line 32 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

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

        
        #line default
        #line hidden
        
        #line 35 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.Name));

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

        
        #line default
        #line hidden
        
        #line 37 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.Id.ToString("D")));

        
        #line default
        #line hidden
        
        #line 37 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("\")]\r\n\tpublic partial class ");

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.Name));

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(" : ");

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

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("\r\n\t{\r\n\t\t#region Constructors, domain class Id\r\n\t\r\n\t\t/// <summary>\r\n\t\t/// VModellv" +
        "ariante 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 45 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.Id.ToString("D")));

        
        #line default
        #line hidden
        
        #line 45 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(@""");
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name=""store"">Store where new element is to be created.</param>
		/// <param name=""propertyAssignments"">List of domain property id/value pairs to set once the element is created.</param>
		public ");

        
        #line default
        #line hidden
        
        #line 51 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.Name));

        
        #line default
        #line hidden
        
        #line 51 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(@"(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
		{
		}
		
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name=""partition"">Partition where new element is to be created.</param>
		/// <param name=""propertyAssignments"">List of domain property id/value pairs to set once the element is created.</param>
		public ");

        
        #line default
        #line hidden
        
        #line 61 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.Name));

        
        #line default
        #line hidden
        
        #line 61 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(@"(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
			: base(partition, propertyAssignments)
		{
		}
		#endregion
		
	    /// <summary>
        /// Gets the unique name of this diagram.
        /// </summary>
        public override string UniqueName
        {
            get
			{
				return """);

        
        #line default
        #line hidden
        
        #line 74 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 74 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.Name));

        
        #line default
        #line hidden
        
        #line 74 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("\";\r\n\t\t\t}\r\n        }\r\n\t\t\r\n        /// <summary>\r\n        /// Initialize.\r\n        " +
        "/// </summary>\r\n        public override void Initialize()\r\n        {\r\n");

        
        #line default
        #line hidden
        
        #line 83 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"

	if( diagram is DesignerDiagramClass )
	{
		foreach(DiagramClass d in (diagram as DesignerDiagramClass).IncludedDiagramClasses )
		{

        
        #line default
        #line hidden
        
        #line 88 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("\t\t\tAddIncludedDiagram(new ");

        
        #line default
        #line hidden
        
        #line 89 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.ModelContext.MetaModel.Namespace));

        
        #line default
        #line hidden
        
        #line 89 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 89 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.Name));

        
        #line default
        #line hidden
        
        #line 89 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("(this.Store));\r\n");

        
        #line default
        #line hidden
        
        #line 90 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"

		}
	}
	

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

        
        #line default
        #line hidden
        
        #line 96 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"


	if( CodeGenerationUtilities.NeedsLinkRules(dm) )
	{

        
        #line default
        #line hidden
        
        #line 100 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(@"
        /// <summary>
        /// Gets the relationship shapes factory helper. Needs to be derived in the actual instance class.
        /// </summary>
        /// <returns></returns>
        public override DslEditorDiagrams::ModelLinkAddRuleForRSShapes.RSShapesFactoryHelper GetRSShapesFactoryHelper()
        {
            return ");

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

        
        #line default
        #line hidden
        
        #line 108 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("LinkForShapesAdded.");

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

        
        #line default
        #line hidden
        
        #line 108 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("ElementForShapesFactoryHelper.Instance;\r\n        }\r\n");

        
        #line default
        #line hidden
        
        #line 110 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"

	}
	if( CodeGenerationUtilities.NeedsMappingLinkRules(dm) )
	{

        
        #line default
        #line hidden
        
        #line 114 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(@"
        /// <summary>
        /// Gets the mapping relationship shapes factory helper.  Needs to be derived in the actual instance class.
        /// </summary>
        /// <returns></returns>
        public override DslEditorDiagrams::ModelLinkAddRuleForMappingRSShapes.RSShapesFactoryHelper GetMappingRSShapesFactoryHelper()
        {
            return ");

        
        #line default
        #line hidden
        
        #line 122 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 122 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("MappingLinkForShapesAdded.");

        
        #line default
        #line hidden
        
        #line 122 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 122 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("ElementForShapesFactoryHelper.Instance;\r\n        }\r\n");

        
        #line default
        #line hidden
        
        #line 124 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"

	}	

        
        #line default
        #line hidden
        
        #line 126 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write(@"		
		#region Methods		
		/// <summary>
        /// Adds a proto element to the current element.
        /// </summary>
        /// <param name=""protoElement"">Proto element representation of the element that is to be added.</param>
        /// <param name=""groupMerger"">
        /// Group merger class used to track id mapping, merge errors/warnings and 
        /// postprocess merging by rebuilding reference relationships.
        /// </param>
        /// <param name=""isRoot"">Root element?</param>
        public override void ModelMerge(DslEditorModeling::ModelProtoElement protoElement, DslEditorModeling::ModelProtoGroupMerger groupMerger, bool isRoot)
		{
");

        
        #line default
        #line hidden
        
        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"

	if( !diagram.IsCustom )
	{

        
        #line default
        #line hidden
        
        #line 143 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"
this.Write("\t\t\t// TODO\t\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 145 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"

	}

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

        
        #line default
        #line hidden
        
        #line 152 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DiagramGenerator.tt"

}
public string GenerateDomainEnumeration(MetaModel dm, DomainEnumeration domainEnum) 
{
	this.GenerationEnvironment = null;
	this.GenerateDomainEnumerationInternal(dm, domainEnum);
	return this.GenerationEnvironment.ToString();
}
Ejemplo n.º 6
0
        public MetaModel LoadModel(DslModeling::SerializationResult serializationResult, DslModeling::Partition partition, string fileName, DslModeling::ISchemaResolver schemaResolver, DslValidation::ValidationController validationController, DslModeling::ISerializerLocator serializerLocator, bool bStartT, bool bIsTopMost)
        {
            #region Model
            #region Check Parameters
            if (serializationResult == null)
                throw new global::System.ArgumentNullException("serializationResult");
            if (partition == null)
                throw new global::System.ArgumentNullException("partition");
            if (string.IsNullOrEmpty(fileName))
                throw new global::System.ArgumentNullException("fileName");
            #endregion

            // Ensure there is a transaction for this model to Load in.
            if (!partition.Store.TransactionActive)
            {
                throw new global::System.InvalidOperationException(LanguageDSLDomainModel.SingletonResourceManager.GetString("MissingTransaction"));
            }

            MetaModel modelRoot = null;
            DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(partition.Store);
            DslModeling::DomainClassXmlSerializer modelRootSerializer = directory.GetSerializer(MetaModel.DomainClassId);
            global::System.Diagnostics.Debug.Assert(modelRootSerializer != null, "Cannot find serializer for MetaModel!");
            if (modelRootSerializer != null)
            {
                using (global::System.IO.FileStream fileStream = global::System.IO.File.OpenRead(fileName))
                {
                    DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, fileStream.Name, serializationResult);
                    this.InitializeSerializationContext(partition, serializationContext, true);
                    DslModeling::TransactionContext transactionContext = new DslModeling::TransactionContext();
                    transactionContext.Add(DslModeling::SerializationContext.TransactionContextKey, serializationContext);

                    DslModeling::Transaction t = null;
                    if (bStartT)
                    {
                        t = partition.Store.TransactionManager.BeginTransaction("Load Model from " + fileName, true, transactionContext);
                    }

                    // Ensure there is some content in the file.  Blank (or almost blank, to account for encoding header bytes, etc.)
                    // files will cause a new root element to be created and returned. 
                    if (fileStream.Length > 5)
                    {
                        try
                        {
                            global::System.Xml.XmlReaderSettings settings = LanguageDSLSerializationHelper.Instance.CreateXmlReaderSettings(serializationContext, false);
                            using (global::System.Xml.XmlReader reader = global::System.Xml.XmlReader.Create(fileStream, settings))
                            {
                                // Attempt to read the encoding.
                                reader.Read(); // Move to the first node - will be the XmlDeclaration if there is one.
                                global::System.Text.Encoding encoding;
                                if (this.TryGetEncoding(reader, out encoding))
                                {
                                    serializationResult.Encoding = encoding;
                                }

                                // Load any additional domain models that are required
                                DslModeling::SerializationUtilities.ResolveDomainModels(reader, serializerLocator, partition.Store);

                                reader.MoveToContent();


                                modelRoot = modelRootSerializer.TryCreateInstance(serializationContext, reader, partition) as MetaModel;
                                if (modelRoot != null && !serializationResult.Failed)
                                {
                                    modelRoot.BaseDirectory = MetaModelLibraryBase.GetBaseDirectory(fileName);
                                    modelRoot.FilePath = fileName;
                                    this.ReadRootElement(serializationContext, modelRoot, reader, schemaResolver);
                                }
                            }

                        }
                        catch (global::System.Xml.XmlException xEx)
                        {
                            DslModeling::SerializationUtilities.AddMessage(
                                serializationContext,
                                DslModeling::SerializationMessageKind.Error,
                                xEx
                            );
                        }
                    }

                    if (modelRoot == null && !serializationResult.Failed)
                    {
                        // create model root if it doesn't exist.
                        modelRoot = this.CreateModelHelper(partition);
                        modelRoot.BaseDirectory = MetaModelLibraryBase.GetBaseDirectory(fileName);
                        modelRoot.FilePath = fileName;
                    }
                    if (bStartT)
                        if (t.IsActive)
                            t.Commit();

                    // Do load-time validation if a ValidationController is provided.
                    if (!serializationResult.Failed && validationController != null)
                    {
                        using (new SerializationValidationObserver(serializationResult, validationController))
                        {
                            validationController.Validate(partition, DslValidation::ValidationCategories.Load);
                        }
                    }
                }
            }

            #endregion

            MetaModel model = modelRoot;
            if (bIsTopMost)
                model.IsTopMost = true;

            #region Diagrams

            System.IO.FileInfo info = new System.IO.FileInfo(fileName);
            string fileNameDiagram = info.DirectoryName + "\\" + info.Name.Remove(info.Name.Length - info.Extension.Length, info.Extension.Length) + DiagramExtension;

            View view = null;
            if (System.IO.File.Exists(fileNameDiagram))
            {
                //DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(partition.Store);
                DslModeling::DomainClassXmlSerializer viewSerializer = directory.GetSerializer(View.DomainClassId);
                global::System.Diagnostics.Debug.Assert(viewSerializer != null, "Cannot find serializer for View!");
                if (viewSerializer != null)
                {
                    using (global::System.IO.FileStream fileStream = global::System.IO.File.OpenRead(fileNameDiagram))
                    {
                        DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, fileStream.Name, serializationResult);
                        this.InitializeSerializationContext(partition, serializationContext, true);
                        DslModeling::TransactionContext transactionContext = new DslModeling::TransactionContext();
                        transactionContext.Add(DslModeling::SerializationContext.TransactionContextKey, serializationContext);

                        DslModeling::Transaction t = null;
                        if (bStartT)
                            t = partition.Store.TransactionManager.BeginTransaction("Load Model from " + fileNameDiagram, true, transactionContext);

                        // Ensure there is some content in the file.  Blank (or almost blank, to account for encoding header bytes, etc.)
                        // files will cause a new root element to be created and returned. 
                        if (fileStream.Length > 5)
                        {
                            try
                            {
                                global::System.Xml.XmlReaderSettings settings = LanguageDSLSerializationHelper.Instance.CreateXmlReaderSettings(serializationContext, false);
                                using (global::System.Xml.XmlReader reader = global::System.Xml.XmlReader.Create(fileStream, settings))
                                {
                                    // Attempt to read the encoding.
                                    reader.Read(); // Move to the first node - will be the XmlDeclaration if there is one.
                                    global::System.Text.Encoding encoding;
                                    if (this.TryGetEncoding(reader, out encoding))
                                    {
                                        serializationResult.Encoding = encoding;
                                    }
                                    reader.MoveToContent();

                                    view = viewSerializer.TryCreateInstance(serializationContext, reader, partition) as View;
                                    if (view != null && !serializationResult.Failed)
                                    {
                                        // Use a validating reader if possible
                                        viewSerializer.Read(serializationContext, view, reader);

                                        model.View = view;
                                    }
                                }
                            }

                            catch (global::System.Xml.XmlException xEx)
                            {
                                DslModeling::SerializationUtilities.AddMessage(
                                    serializationContext,
                                    DslModeling::SerializationMessageKind.Error,
                                    xEx
                                );
                            }
                        }

                        if (bStartT)
                            if (t.IsActive)
                                t.Commit();

                    }
                }
            }
            #endregion

            //if( bIsTopMost )
            SerializationPostProcessor.PostProcessModelLoad(model);

            return model;
        }
public string GenerateDiagramViewModel(MetaModel dm, DiagramClass diagramClass)
{
	this.GenerationEnvironment = null;
	this.GenerateDiagramViewModelInternal(dm, diagramClass);
	return this.GenerationEnvironment.ToString();
}
public void GenerateLayoutManagerLayout(MetaModel dm)
{

        
        #line default
        #line hidden
        
        #line 10 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("<DefaultLayouts>\r\n");

        
        #line default
        #line hidden
        
        #line 12 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"

	foreach(BaseModelContext modelContext in this.MetaModel.ModelContexts)	
		if( modelContext is ModelContext)
		{
			string diagramDesignerClassName = "DesignerDiagramSurfaceDockWindowPane";
			foreach( DiagramClass diagramClass in (modelContext as ModelContext).DiagramClasses)
				if( diagramClass is DesignerDiagramClass )
					diagramDesignerClassName = diagramClass.Name + "SurfaceDockWindowPane";

        
        #line default
        #line hidden
        
        #line 20 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("\t<DefaultLayout name=\"");

        
        #line default
        #line hidden
        
        #line 21 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(modelContext.Name));

        
        #line default
        #line hidden
        
        #line 21 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("\">\r\n");

        
        #line default
        #line hidden
        
        #line 22 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"

	this.PushIndent("\t\t");		

        
        #line default
        #line hidden
        
        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write(@"<DockingManager version=""1.3.0"">
    <ResizingPanel ResizeWidth=""*"" ResizeHeight=""*"" EffectiveSize=""0,0"" Orientation=""Horizontal"">
        <DockablePane ResizeWidth=""282"" ResizeHeight=""*"" EffectiveSize=""282,1000"" ID=""2911486e-0e55-40fd-9f2c-366fd5d06549"" Anchor=""Left"" IsAutoHidden=""false"">
            <DockableContent Name=""ModelTreeViewDockWindow"" FloatingWindowSize=""250,400"" ChildIndex=""0"" Width=""250"" Height=""594"" Anchor=""Left"" State=""Docked"" ContainerPaneID=""5681c1d1-6d75-4334-8ac6-220a51501503"" />
        </DockablePane>
        <ResizingPanel ResizeWidth=""*"" ResizeHeight=""*"" EffectiveSize=""1632,1000"" Orientation=""Vertical"">
            <ResizingPanel ResizeWidth=""*"" ResizeHeight=""*"" EffectiveSize=""1632,594"" Orientation=""Horizontal"">
                <DocumentPane IsMain=""true"" SelectedIndex=""0"">
                    <DockableContent Name=""");

        
        #line default
        #line hidden
        
        #line 33 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramDesignerClassName));

        
        #line default
        #line hidden
        
        #line 33 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("\" FloatingWindowSize=\"250,400\" ChildIndex=\"0\" Width=\"1046\" Height=\"594\" Anchor=\"N" +
        "one\" State=\"Document\" />\r\n");

        
        #line default
        #line hidden
        
        #line 34 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"

					/*for(int i = 1; i < this.MetaModel.AllDiagramClasses.Count; i++)
					{
						DiagramClass diagramClass = this.MetaModel.AllDiagramClasses[i];

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("                    <DockableContent Name=\"");

        
        #line default
        #line hidden
        
        #line 39 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Name));

        
        #line default
        #line hidden
        
        #line 39 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("DiagramSurfaceDockWindowPane\" FloatingWindowSize=\"250,400\" Width=\"1046\" Height=\"5" +
        "94\" Anchor=\"None\" State=\"Document\" ChildIndex=\"0\" />\t\t\t\t\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"

					}*/

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("                </DocumentPane>\r\n                <DockablePane ResizeWidth=\"327\" " +
        "ResizeHeight=\"*\" EffectiveSize=\"327,594\" ID=\"5681c1d1-6d75-4334-8ac6-220a5150150" +
        "3\" Anchor=\"Right\" IsAutoHidden=\"false\">\r\n                    <DockableContent Na" +
        "me=\"PropertiesDockWindowPane\" FloatingWindowSize=\"250,400\" />\r\n                <" +
        "/DockablePane>\r\n            </ResizingPanel>\r\n            <DockablePane ResizeWi" +
        "dth=\"*\" ResizeHeight=\"400\" EffectiveSize=\"1632,400\" ID=\"13b34325-ea7b-44a1-b3a2-" +
        "67a4fad20bf5\" Anchor=\"Bottom\" SelectedIndex=\"0\" IsAutoHidden=\"false\">\r\n         " +
        "       <DockableContent Name=\"ErrorListDockWindow\" FloatingWindowSize=\"250,400\" " +
        "ChildIndex=\"0\" Width=\"200\" Height=\"1000\" Anchor=\"Bottom\" State=\"Docked\" Containe" +
        "rPaneID=\"f88d48ad-60b4-4b51-93f8-04e63b2f4ead\" />\r\n                <DockableCont" +
        "ent Name=\"DependenciesDockWindowPane\" FloatingWindowSize=\"250,400\" ChildIndex=\"0" +
        "\" Width=\"200\" Height=\"594\" Anchor=\"Bottom\" State=\"Docked\" ContainerPaneID=\"cd312" +
        "27d-6e26-4b35-9e3e-586f2dc4c053\" />\r\n            </DockablePane>\r\n        </Resi" +
        "zingPanel>\r\n    </ResizingPanel>\r\n    <Hidden>\r\n        <DockableContent Name=\"S" +
        "earchResultViewModel\" FloatingWindowSize=\"400,500\" ChildIndex=\"2\" Width=\"1632\" H" +
        "eight=\"400\" Anchor=\"Bottom\" State=\"Docked\" ContainerPaneID=\"13b34325-ea7b-44a1-b" +
        "3a2-67a4fad20bf5\" />\r\n        <DockableContent Name=\"SearchViewModel\" FloatingWi" +
        "ndowSize=\"200,500\" ChildIndex=\"0\" Width=\"100\" Height=\"100\" Anchor=\"None\" State=\"" +
        "DockableWindow\" ContainerPaneID=\"0187e39b-2379-4e8b-bf3f-db6ce7ca72fa\" />\r\n    <" +
        "/Hidden>\r\n    <Windows />\r\n</DockingManager>\r\n");

        
        #line default
        #line hidden
        
        #line 60 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"

	this.PopIndent();

        
        #line default
        #line hidden
        
        #line 62 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("\t</DefaultLayout>\r\n");

        
        #line default
        #line hidden
        
        #line 64 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 66 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"
this.Write("</DefaultLayouts>\r\n");

        
        #line default
        #line hidden
        
        #line 68 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\LayoutManagerLayoutGenerator.tt"

}
private void GenerateSearchProcessor(MetaModel dm)
{

        
        #line default
        #line hidden
        
        #line 18 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("namespace ");

        
        #line default
        #line hidden
        
        #line 19 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

        
        #line default
        #line hidden
        
        #line 19 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("\r\n{\r\n\t/// <summary>\r\n\t/// Class which provides search functionality.\r\n\t/// </summ" +
        "ary>\r\n\tpublic partial class ");

        
        #line default
        #line hidden
        
        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("SearchProcessor : ");

        
        #line default
        #line hidden
        
        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("SearchProcessorBase\r\n\t{\r\n\t\t#region Singleton Instance\r\n\t\tprivate static ");

        
        #line default
        #line hidden
        
        #line 27 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 27 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(@"SearchProcessor elementSearchProcessor = null;
		
        /// <summary>
        /// Singleton instance.
        /// </summary>
        [global::System.Diagnostics.DebuggerBrowsable(global::System.Diagnostics.DebuggerBrowsableState.Never)] // Will trigger creation otherwise.
        public static ");

        
        #line default
        #line hidden
        
        #line 33 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 33 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("SearchProcessor Instance\r\n        {\r\n            [global::System.Diagnostics.Debu" +
        "ggerStepThrough]\r\n            get\r\n            {\r\n                if( elementSea" +
        "rchProcessor == null )\r\n\t\t\t\t{\r\n\t\t\t\t\telementSearchProcessor = new ");

        
        #line default
        #line hidden
        
        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("SearchProcessor();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn elementSearchProcessor;\r\n            " +
        "}\r\n        }\r\n\t\t\r\n\t\tprivate ");

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("SearchProcessor() : base()\r\n\t\t{\r\n\t\t}\r\n        #endregion\r\n\t}\r\n\t\r\n\t/// <summary>\r\n" +
        "\t/// Class which provides search functionality.\r\n\t/// </summary>\r\n\tpublic abstra" +
        "ct class ");

        
        #line default
        #line hidden
        
        #line 56 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 56 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("SearchProcessorBase : DslEditorModeling::ModelElementSearchProcessor\r\n\t{\r\n\t\t#regi" +
        "on Constructor\r\n\t\t/// <summary>\r\n        /// Constructor.\r\n        /// </summary" +
        ">\r\n\t\tprotected ");

        
        #line default
        #line hidden
        
        #line 62 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 62 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"
this.Write("SearchProcessorBase()\r\n\t\t{\r\n\t\t}\r\n        #endregion\r\n\t}\t\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 68 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\SearchProcessorGenerator.tt"

}
        private static void FixUpModelContext(MetaModel model)
        {
            ModelContext modelContext = new ModelContext(model.Store);
            modelContext.Name = "DefaultContext";
            modelContext.IsDefault = true;
            model.ModelContexts.Add(modelContext);

            DomainClass domainClass = new DomainClass(model.Store);
            domainClass.Name = "DomainModel";
            domainClass.IsDomainModel = true;
            domainClass.DisplayName = "DomainModel";
            domainClass.SerializationName = "DomainModel";
            modelContext.Classes.Add(domainClass);
        }
        private static PropertyGridEditor GetPropertyGridEditor(MetaModel model, string name)
        {
            foreach (PropertyGridEditor p in model.PropertyGridEditors)
                if (p.Name == name)
                    return p;

            return null;
        }
        private static void FixUpPropertyGridEditors(MetaModel model)
        {
            PropertyGridEditor stringEditor = new PropertyGridEditor(model.Store);
            stringEditor.Name = "StringEditorViewModel";
            stringEditor.Namespace = "Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.PropertyGrid";
            stringEditor.ShouldBeGenerated = false;
            model.PropertyGridEditors.Add(stringEditor);

            PropertyGridEditor boolEditor = new PropertyGridEditor(model.Store);
            boolEditor.Name = "BooleanEditorViewModel";
            boolEditor.Namespace = "Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.PropertyGrid";
            boolEditor.ShouldBeGenerated = false;
            model.PropertyGridEditors.Add(boolEditor);

            PropertyGridEditor enumEditor = new PropertyGridEditor(model.Store);
            enumEditor.Name = "EnumerationEditorViewModel";
            enumEditor.Namespace = "Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.PropertyGrid";
            enumEditor.ShouldBeGenerated = false;
            model.PropertyGridEditors.Add(enumEditor);

            PropertyGridEditor dEditor = new PropertyGridEditor(model.Store);
            dEditor.Name = "DoubleEditorViewModel";
            dEditor.Namespace = "Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.PropertyGrid";
            dEditor.ShouldBeGenerated = false;
            model.PropertyGridEditors.Add(dEditor);

            PropertyGridEditor iEditor = new PropertyGridEditor(model.Store);
            iEditor.Name = "IntegerEditorViewModel";
            iEditor.Namespace = "Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.PropertyGrid";
            iEditor.ShouldBeGenerated = false;
            model.PropertyGridEditors.Add(iEditor);
        }
        private static void FixUpDomainTypes(MetaModel model)
        {
            // String
            ExternalType stringType = new ExternalType(model.Store);
            stringType.Name = "String";
            stringType.Namespace = "System";
            stringType.DisplayName = "String";
            stringType.PropertyGridEditor = GetPropertyGridEditor(model, "StringEditorViewModel");
            model.DomainTypes.Add(stringType);

            // Boolean?
            ExternalType boolType = new ExternalType(model.Store);
            boolType.Name = "Boolean?";
            boolType.Namespace = "System";
            boolType.DisplayName = "Boolean";
            boolType.PropertyGridEditor = GetPropertyGridEditor(model, "BooleanEditorViewModel");
            model.DomainTypes.Add(boolType);

            // Guid?
            ExternalType guidType = new ExternalType(model.Store);
            guidType.Name = "Guid?";
            guidType.Namespace = "System";
            guidType.DisplayName = "Guid";
            model.DomainTypes.Add(guidType);

            // Int32?
            ExternalType in32Type = new ExternalType(model.Store);
            in32Type.Name = "Int32?";
            in32Type.Namespace = "System";
            in32Type.DisplayName = "Integer";
            in32Type.RequiresSerializationConversion = true;
            in32Type.PropertyGridEditor = GetPropertyGridEditor(model, "IntegerEditorViewModel");
            model.DomainTypes.Add(in32Type);

            // Double?
            ExternalType dType = new ExternalType(model.Store);
            dType.Name = "Double?";
            dType.Namespace = "System";
            dType.DisplayName = "Double";
            dType.RequiresSerializationConversion = true;
            dType.PropertyGridEditor = GetPropertyGridEditor(model, "DoubleEditorViewModel");
            model.DomainTypes.Add(dType);
        }
        private static void FixUpDerivedRelationships(DomainRelationship domainClass, MetaModel model)
        {
            if (domainClass.ModelContext.MetaModel == model)
            {
                if (domainClass is EmbeddingRelationship)
                {
                    EmbeddingRelationship con = domainClass as EmbeddingRelationship;
                    SerializationHelper.UpdateSerializationDomainProperties(domainClass.Store, con.SerializedEmbeddingRelationship, domainClass);
                }

                if (domainClass is ReferenceRelationship)
                {
                    ReferenceRelationship con = domainClass as ReferenceRelationship;
                    SerializationHelper.UpdateSerializationDomainProperties(domainClass.Store, con.SerializedReferenceRelationship, domainClass);
                }
            }

            foreach (DomainRelationship derivedClass in domainClass.DerivedRelationships)
                FixUpDerivedRelationships(derivedClass, model);
        }
private void GenerateCodeExampleForDiagramInternal(MetaModel dm)
{	

        
        #line default
        #line hidden
        
        #line 19 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\CodeExamplesGeneratorHelper.tt"
this.Write("    /// <summary>\r\n    /// This diagram was generated to illustrate some concepts" +
        " of PDE, especially when working with views.\r\n    /// </summary>\r\n    public cla" +
        "ss CodeExamplesDiagram : DslEditorViewDiagrams::DiagramSurfaceViewModel\r\n    {\r\n" +
        "        /// <summary>\r\n        /// Constuctor.\r\n        /// </summary>\r\n        " +
        "/// <param name=\"viewModelStore\">View model store containing this view model.</p" +
        "aram>\r\n\t\t/// <param name=\"diagram\">Diagram.</param>\r\n\t\t/// <param name=\"modelCon" +
        "text\">Model context.</param>\r\n        public CodeExamplesDiagram(VModellXTViewMo" +
        "delStore viewModelStore, DslEditorDiagrams::Diagram diagram, DslEditorModeling::" +
        "ModelContext modelContext)\r\n            : base(viewModelStore, diagram, modelCon" +
        "text)\r\n        {\r\n\t\t\t\r\n        }\r\n\r\n        #region 1. Messaging\r\n        /*****" +
        "**********************\r\n           For the purpose of messaging PDE consists of " +
        "an EventManager allowing the subscription or unsubscption to events.\r\n          " +
        " Every event can either be published or be subscribed to (see example below). Th" +
        "e concept of messaging in PDE follows the \r\n           EventAggregator pattern (" +
        "see PRISM for more details).\r\n         \r\n           The following events might b" +
        "e of interest when working with views:\r\n            * ActiveViewChangedEvent    " +
        "(You can also override the \'IsActiveView\' method)\r\n            * BringToFrontVie" +
        "wModelRequestEvent\r\n            * CloseViewModelRequestEvent\r\n            * Open" +
        "ViewModelEvent\r\n            * ResetViewModelEvent   (You can also override the \'" +
        "Reset\' method)\r\n            * SelectionChangedEvent   (You can also override the" +
        " \'ReactOnViewSelection\' method)\r\n            * ShowViewModelRequestEvent\r\n      " +
        "      \r\n           PDE also has evets for model-based changes:\r\n            * Mo" +
        "delElementAddedEvent\r\n            * ModelElementCustomEvent\r\n            * Model" +
        "ElementDeletedEvent\r\n            * ModelElementEvent\r\n            * ModelElement" +
        "LinkAddedEvent\r\n            * ModelElementLinkDeletedEvent\r\n            * ModelE" +
        "lementPropertyChangedEvent\r\n            * ModelRolePlayerChangedEvent\r\n         " +
        "   * ModelRolePlayerMovedEvent\r\n           \r\n            (See Tum.PDE.ToolFramew" +
        "ork.Modeling.Visualization.ViewModel.Messaging.Events for more details.)\r\n      " +
        "   \r\n            Examle 1: Subscribe to model element creation and deletion even" +
        "ts for a specific element.\r\n            Examle 2: Subscribe to relationship crea" +
        "tion, deletion and role player changes for a specific relationship.\r\n          \r" +
        "\n           HINT: Keep in mind that there you can have specific element view mod" +
        "els generated for every element of your model.\r\n                 To do so, selec" +
        "t an element in the LanguageDSL-Designer and set the property \"Generate Specific" +
        " View Model\" to true.\r\n        ***************************/\r\n        protected o" +
        "verride void Subscribe()\r\n        {\r\n            base.Subscribe();\r\n\r\n          " +
        "  // HINT: keep in mind that there are multiple overloads for the Subscribe/Unsu" +
        "bscribe methods\r\n\r\n            // Example 1: Vorgehensbaustein\r\n            this" +
        ".EventManager.GetEvent<DslEditorEvents::ModelElementAddedEvent>().Subscribe(\r\n  " +
        "              this.Store.DomainDataDirectory.FindDomainClass(Tum.VModellXT.Stati" +
        "k.Vorgehensbaustein.DomainClassId), OnVorgehensbausteinAdded);\r\n            this" +
        ".EventManager.GetEvent<DslEditorEvents::ModelElementDeletedEvent>().Subscribe(\r\n" +
        "                this.Store.DomainDataDirectory.FindDomainClass(Tum.VModellXT.Sta" +
        "tik.Vorgehensbaustein.DomainClassId), OnVorgehensbausteinDeleted);\r\n\r\n          " +
        "  /*\r\n             *  1. Every model element has a unique DomainClassID\r\n       " +
        "      *  2. The metamodel to the generated model is available through domain dat" +
        "a reflection.\r\n             *     This is the DomainDataDirectory contained in t" +
        "he Store.\r\n             *  3. The method FindDomainClass returns a DomainClassIn" +
        "fo class, which basically is\r\n             *     equal to the Vorgehensbaustein-" +
        "DomainClass in the LanguageDSL (see DomainMetaModel.lngdsl).\r\n             *    " +
        " This DomainClassInfo allows to lookup certain properties of the metamodel class" +
        " at runtime.\r\n            */\r\n\r\n\r\n            // Example 2: VorgehensbausteinBas" +
        "iertAufVorgehensbaustein, assume we have a Vorgehensbaustein present.\r\n         " +
        "   this.EventManager.GetEvent<DslEditorEvents::ModelElementLinkAddedEvent>().Sub" +
        "scribe(this.Store.DomainDataDirectory.GetDomainRelationship(Tum.VModellXT.Statik" +
        ".VorgehensbausteinBasiertAufVorgehensbaustein.DomainClassId),\r\n                t" +
        "rue, vorgehensbaustein.Id, new System.Action<DslModeling::ElementAddedEventArgs>" +
        "(OnReferenceAdded));\r\n\r\n            this.EventManager.GetEvent<DslEditorEvents::" +
        "ModelElementLinkDeletedEvent>().Subscribe(this.Store.DomainDataDirectory.GetDoma" +
        "inRelationship(Tum.VModellXT.Statik.VorgehensbausteinBasiertAufVorgehensbaustein" +
        ".DomainClassId),\r\n                true, vorgehensbaustein.Id, new System.Action<" +
        "DslModeling::ElementDeletedEventArgs>(OnReferenceRemoved));\r\n\r\n            // Ge" +
        "t a notification whenever the source Vorgehensbaustein changes for a referenced " +
        "Vorgehensbaustein\r\n            this.EventManager.GetEvent<DslEditorEvents::Model" +
        "RolePlayerChangedEvent>().Subscribe(this.Store.DomainDataDirectory.GetDomainRole" +
        "(Tum.VModellXT.Statik.VorgehensbausteinBasiertAufVorgehensbaustein.Vorgehensbaus" +
        "teinSourceDomainRoleId),\r\n                new System.Action<DslModeling::RolePla" +
        "yerChangedEventArgs>(OnReferenceChanged));\r\n\r\n            // Get a notification " +
        "whenever the referenced Vorgehensbaustein of a Vorgehensbaustein changes\r\n      " +
        "      this.EventManager.GetEvent<DslEditorEvents::ModelRolePlayerChangedEvent>()" +
        ".Subscribe(this.Store.DomainDataDirectory.GetDomainRole(Tum.VModellXT.Statik.Vor" +
        "gehensbausteinBasiertAufVorgehensbaustein.VorgehensbausteinTargetDomainRoleId),\r" +
        "\n                new System.Action<DslModeling::RolePlayerChangedEventArgs>(OnRe" +
        "ferenceChanged));\r\n        }\r\n\r\n        protected override void Unsubscribe()\r\n " +
        "       {\r\n            base.Unsubscribe();\r\n\r\n            // Example 1:\r\n        " +
        "    this.EventManager.GetEvent<DslEditorEvents::ModelElementAddedEvent>().Unsubs" +
        "cribe(\r\n                this.Store.DomainDataDirectory.FindDomainClass(Tum.VMode" +
        "llXT.Statik.Vorgehensbaustein.DomainClassId), OnVorgehensbausteinAdded);\r\n      " +
        "      this.EventManager.GetEvent<DslEditorEvents::ModelElementDeletedEvent>().Un" +
        "subscribe(\r\n                this.Store.DomainDataDirectory.FindDomainClass(Tum.V" +
        "ModellXT.Statik.Vorgehensbaustein.DomainClassId), OnVorgehensbausteinDeleted);\r\n" +
        "\r\n            // Example 2: VorgehensbausteinBasiertAufVorgehensbaustein, assume" +
        " we have a Vorgehensbaustein present.\r\n            this.EventManager.GetEvent<Ds" +
        "lEditorEvents::ModelElementLinkAddedEvent>().Unsubscribe(this.Store.DomainDataDi" +
        "rectory.GetDomainRelationship(Tum.VModellXT.Statik.VorgehensbausteinBasiertAufVo" +
        "rgehensbaustein.DomainClassId),\r\n                true, vorgehensbaustein.Id, new" +
        " System.Action<DslModeling::ElementAddedEventArgs>(OnReferenceAdded));\r\n        " +
        "    this.EventManager.GetEvent<DslEditorEvents::ModelElementLinkDeletedEvent>()." +
        "Unsubscribe(this.Store.DomainDataDirectory.GetDomainRelationship(Tum.VModellXT.S" +
        "tatik.VorgehensbausteinBasiertAufVorgehensbaustein.DomainClassId),\r\n            " +
        "    true, vorgehensbaustein.Id, new System.Action<DslModeling::ElementDeletedEve" +
        "ntArgs>(OnReferenceRemoved));\r\n            this.EventManager.GetEvent<DslEditorE" +
        "vents::ModelRolePlayerChangedEvent>().Unsubscribe(this.Store.DomainDataDirectory" +
        ".GetDomainRole(Tum.VModellXT.Statik.VorgehensbausteinBasiertAufVorgehensbaustein" +
        ".VorgehensbausteinSourceDomainRoleId),\r\n                new System.Action<DslMod" +
        "eling::RolePlayerChangedEventArgs>(OnReferenceChanged));\r\n        }\r\n\r\n        /" +
        "/ Example 1:\r\n        private void OnVorgehensbausteinAdded(DslModeling::Element" +
        "AddedEventArgs args)\r\n        {\r\n            Tum.VModellXT.Statik.Vorgehensbaust" +
        "ein element = args.ModelElement as Tum.VModellXT.Statik.Vorgehensbaustein;\r\n    " +
        "        this.VorgehensbausteinVM = new DslEditorViewModels::BaseModelElementView" +
        "Model(this.ViewModelStore, element, true);\r\n        }\r\n        private void OnVo" +
        "rgehensbausteinDeleted(DslModeling::ElementDeletedEventArgs args)\r\n        {\r\n  " +
        "          Tum.VModellXT.Statik.Vorgehensbaustein element = args.ModelElement as " +
        "Tum.VModellXT.Statik.Vorgehensbaustein;\r\n\t\t\tif( this.VorgehensbausteinVM != null" +
        " )\r\n\t\t\t\tif( this.VorgehensbausteinVM.Element == element )\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.Vorg" +
        "ehensbausteinVM.Dispose();\r\n\t\t\t\t\tthis.VorgehensbausteinVM = null;\r\n\t\t\t\t}\r\n      " +
        "  }\r\n\t\tprivate DslEditorViewModels::BaseModelElementViewModel vorgehensbausteinV" +
        "M = null;\r\n\t\tprivate DslEditorViewModels::BaseModelElementViewModel Vorgehensbau" +
        "steinVM\r\n\t\t{\r\n\t\t\tget\r\n\t\t\t{\r\n\t\t\t\treturn this.vorgehensbausteinVM;\r\n\t\t\t}\r\n\t\t\tpriva" +
        "te set\r\n\t\t\t{\r\n\t\t\t\tthis.vorgehensbausteinVM = value;\r\n\t\t\t\tOnPropertyChanged(\"Vorg" +
        "ehensbausteinVM\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n        // Example 2:\r\n        private void Add" +
        "Reference(Tum.VModellXT.Statik.Vorgehensbaustein node)\r\n        {\r\n\t\t\t// ..\r\n   " +
        "     }\r\n        private void RemoveReference(Tum.VModellXT.Statik.Vorgehensbaust" +
        "ein node)\r\n        {\r\n\t\t\t// ..\r\n\t    }\r\n\r\n        private void OnReferenceAdded(" +
        "DslModeling::ElementAddedEventArgs args)\r\n        {\r\n            Tum.VModellXT.S" +
        "tatik.VorgehensbausteinBasiertAufVorgehensbaustein con\r\n                = args.M" +
        "odelElement as Tum.VModellXT.Statik.VorgehensbausteinBasiertAufVorgehensbaustein" +
        ";\r\n            if (con != null)\r\n            {\r\n                AddReference(con" +
        ".VorgehensbausteinTarget);\r\n            }\r\n        }\r\n        private void OnRef" +
        "erenceRemoved(DslModeling::ElementDeletedEventArgs args)\r\n        {\r\n           " +
        " Tum.VModellXT.Statik.VorgehensbausteinBasiertAufVorgehensbaustein con\r\n        " +
        "        = args.ModelElement as Tum.VModellXT.Statik.VorgehensbausteinBasiertAufV" +
        "orgehensbaustein;\r\n            if (con != null)\r\n            {\r\n                " +
        "RemoveReference(con.VorgehensbausteinTarget);\r\n            }\r\n\r\n        }\r\n     " +
        "   private void OnReferenceChanged(DslModeling::RolePlayerChangedEventArgs args)" +
        "\r\n        {\r\n            Tum.VModellXT.Statik.VorgehensbausteinBasiertAufVorgehe" +
        "nsbaustein con\r\n                = args.ElementLink as Tum.VModellXT.Statik.Vorge" +
        "hensbausteinBasiertAufVorgehensbaustein;\r\n            if (con != null)\r\n        " +
        "    {\r\n                if (args.DomainRole.Id == Tum.VModellXT.Statik.Vorgehensb" +
        "austeinBasiertAufVorgehensbaustein.VorgehensbausteinSourceDomainRoleId)\r\n       " +
        "         {\r\n                    if (args.OldRolePlayerId == vorgehensbaustein.Id" +
        ")\r\n                        RemoveReference(con.VorgehensbausteinTarget);\r\n\r\n    " +
        "                if (args.NewRolePlayerId == vorgehensbaustein.Id)\r\n             " +
        "           AddReference(con.VorgehensbausteinTarget);\r\n                }\r\n      " +
        "          else if (args.DomainRole.Id == global::Tum.VModellXT.Statik.Vorgehensb" +
        "austeinBasiertAufVorgehensbaustein.VorgehensbausteinTargetDomainRoleId)\r\n       " +
        "         {\r\n                    if (args.OldRolePlayer != null)\r\n               " +
        "         RemoveReference(args.OldRolePlayer as global::Tum.VModellXT.Statik.Vorg" +
        "ehensbaustein);\r\n\r\n                    if (args.NewRolePlayer != null)\r\n        " +
        "                AddReference(args.NewRolePlayer as global::Tum.VModellXT.Statik." +
        "Vorgehensbaustein);\r\n                }\r\n            }\r\n        }  \r\n        #end" +
        "region\r\n    \r\n\t\t#region 2. Xaml\r\n\t\t// This Xaml represents a possible view defin" +
        "ition for the code examples diagram\r\n\t\txmlns:vm=\"clr-namespace:Tum.VModellXT.Vie" +
        "wModel\"\r\n\t\t\r\n\t\t// 1. RessourceDictionary (Resources.xaml)\r\n\t\t<DataTemplate DataT" +
        "ype=\"{x:Type vm:CodeExamplesDiagram}\">\r\n        \t<ctrl:CodeExamplesDiagram Horiz" +
        "ontalAlignment=\"Stretch\" VerticalAlignment=\"Stretch\"/>\r\n    \t</DataTemplate>\r\n\t\t" +
        "\r\n\t\t// 2. CodeExamplesDiagram User-Control\r\n\t\t<Grid>\r\n        \t<Grid Margin=\"10\"" +
        ">\r\n            \t<Grid.RowDefinitions>\r\n                \t<RowDefinition Height=\"2" +
        "4\"></RowDefinition>\r\n                \t<RowDefinition Height=\"34\"></RowDefinition" +
        ">\r\n                \t<RowDefinition Height=\"3\"></RowDefinition>\r\n            \t</G" +
        "rid.RowDefinitions>\r\n\r\n            \t<TextBlock Text=\"Current element: \" Grid.Row" +
        "=\"0\" VerticalAlignment=\"Center\"/>\r\n            \t<TextBlock Text=\"{Binding Path=V" +
        "orgehensbausteinVM.DomainElementFullName, Mode=OneTime}\" Grid.Row=\"1\" VerticalAl" +
        "ignment=\"Center\" FontSize=\"16\"/>\r\n            \t<Border Grid.Row=\"2\" Height=\"1\" B" +
        "orderThickness=\"1\" BorderBrush=\"DodgerBlue\"/>\r\n        \t</Grid>\r\n    \t</Grid>\r\n\t" +
        "\t#endregion\r\n\t\r\n\t\t#region 3. Commanding\r\n\t\t// 1. Code:\t\t\r\n\t\tprivate DslEditorCom" +
        "mands::DelegateCommand navigateToElementCommand;\r\n        public DslEditorComman" +
        "ds::DelegateCommand NavigateToElementCommand\r\n        {\r\n            get\r\n      " +
        "      {\r\n                return this.navigateToElementCommand;\r\n            }\r\n " +
        "       }\r\n\t\t\r\n\t\t/// <summary>\r\n        /// Initialize.\r\n        /// </summary>\r\n" +
        "        protected override void Initialize()\r\n        {\r\n            base.Initia" +
        "lize();\r\n\r\n            this.navigateToElementCommand = new DslEditorCommands::De" +
        "legateCommand(NavigateToElementCommandExecuted);\r\n        }\r\n\t\t\r\n\t\tprivate void " +
        "NavigateToElementCommandExecuted()\r\n        {\r\n            BaseModelElementViewM" +
        "odel vm = some selected view model.\r\n            if (vm != null)\r\n            {\r" +
        "\n                if (vm.Element != null)\r\n                {\r\n                   " +
        " SelectedItemsCollection col = new SelectedItemsCollection();\r\n                 " +
        "   col.Add(vm.Element);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Publish event notifying that the selecte" +
        "d element has changed.\r\n                    EventManager.GetEvent<SelectionChang" +
        "edEvent>().Publish(new SelectionChangedEventArgs(this, col));\r\n                }" +
        "\r\n            }\r\n\t\t}\r\n\t\t\r\n\t\t// 2. Xaml (in the data template e.g.:):\r\n\t\t<Button " +
        "Command=\"{Binding Path=NavigateToElementCommand}\">\r\n            ... content\r\n   " +
        "     </Button>\r\n\t\t#endregion\r\n\t\r\n\t\t#region 4. Drag&Drop\r\n\t\t// 1. Code:\r\n        " +
        "public override void DragOver(DropInfo dropInfo)\r\n        {\r\n\t\t\t// ..\r\n        }" +
        "\r\n        public override void Drop(DropInfo dropInfo)\r\n\t\t{\r\n\t\t\t// ..\r\n        }" +
        "\r\n\t\t\r\n\t\t// 2. Xaml:\r\n\t\txmlns:dd=\"clr-namespace:Tum.PDE.ToolFramework.Modeling.Vi" +
        "sualization.Controls.Attached.DragDrop\"\r\n\t\t\r\n\t\t<Border HorizontalAlignment=\"Stre" +
        "tch\" VerticalAlignment=\"Stretch\" \r\n\t\t\tBackground=\"Transparent\" dd:DragDrop.IsDro" +
        "pTarget=\"True\" dd:DragDrop.DropHandler=\"{Binding}\"/>\r\n\t\t#endregion\r\n\t\t\r\n\t\t#regio" +
        "n 5. Transactions\r\n\t\t// Use Transaction to create, modify or delete model elemen" +
        "ts/relationships.\r\n\t\tusing(Transaction t = this.Store.TransactionManager.BeginTr" +
        "ansaction(\"Description\") )\r\n\t\t{\r\n\t\t\tt.Commit();\r\n\t\t}\r\n\t\t\r\n\t\t// HINT: Transaction" +
        " can be nested as well.\r\n\t\t#endregion\r\n\t\t\r\n\t\t#region 6. Domain Model Services\r\n\t" +
        "\t// Every PDE-based DSL has a set of domain model services:\r\n\t\t// * ModelElement" +
        "NameProvider\r\n\t\t// * ModelElementTypeProvider\r\n\t\t// * ModelElementParentProvider" +
        "\r\n\t\t// * ModelElementChildrenProvider\r\n\t\t// * ModelElementParentProvider\r\n\t\t// *" +
        " ...\r\n\t\t// \r\n\t\t// The domain model services can also be accessed from every mode" +
        "l element (element.GetDomainModelServices()).\r\n\t\t#endregion\r\n\t}\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 322 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\CodeExamplesGeneratorHelper.tt"

}
Ejemplo n.º 16
0
        public override ModelElement ResolveMoniker(Moniker moniker)
        {
            Microsoft.VisualStudio.Modeling.ModelElement modelElement;

            #region PropertyGridEditor
            if (moniker.DomainRelationshipInfo.Id == DomainTypeReferencesPropertyGridEditor.DomainClassId)
            {
                propertyGridEditorTypeLookup.TryGetValue(moniker.MonikerName, out modelElement);
                if (modelElement == null)
                {
                    string[] name = moniker.MonikerName.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
                    if (name.Length > 1)
                    {
                        string modelName  = name[0];
                        string editorName = name[1];

                        MetaModel model = FindMetaModel(moniker.Store, modelName);
                        if (model != null)
                        {
                            foreach (PropertyGridEditor editor in model.PropertyGridEditors)
                            {
                                if (editor.Name == editorName)
                                {
                                    modelElement = editor;
                                    propertyGridEditorTypeLookup[moniker.MonikerName] = editor;
                                    break;
                                }
                            }
                        }
                    }

                    return(modelElement);
                }
                else
                {
                    return(modelElement);
                }
            }
            #endregion

            #region DomainEnumeration and ExternalType
            if (moniker.DomainRelationshipInfo.Id == DomainPropertyReferencesType.DomainClassId)
            {
                typeLookup.TryGetValue(moniker.MonikerName, out modelElement);
                if (modelElement == null)
                {
                    string[] name = moniker.MonikerName.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
                    if (name.Length > 2)
                    {
                        string modelName    = name[0];
                        string namespaceStr = name[1];
                        string editorName   = name[2];

                        MetaModel model = FindMetaModel(moniker.Store, modelName);
                        if (model != null)
                        {
                            foreach (DomainType t in model.DomainTypes)
                            {
                                if (t.Name == editorName && t.Namespace == namespaceStr)
                                {
                                    modelElement = t;
                                    typeLookup[moniker.MonikerName] = t;
                                    break;
                                }
                            }
                        }
                    }

                    return(modelElement);
                }
                else
                {
                    return(modelElement);
                }
            }
            #endregion

            ModelElement m = base.ResolveMoniker(moniker);
            if (m == null)
            {
                try
                {
                    Guid guid = new Guid(moniker.MonikerName);
                    m = moniker.Store.ElementDirectory.FindElement(guid);
                }
                catch { }
            }
            if (m == null)
            {
            }
            return(m);
        }
public void GeneratePropertyGridViewModel(MetaModel dm, AttributedDomainElement domainElement)
{
		string name = "PropertyGrid" + domainElement.Name + "ViewModel";
		string baseClass = "DslEditorViewModelPGrid::PropertyGridViewModel";
		string constructorAccessor = "public";
		string modifier = " partial";		
		string classAccessor = "";
		string classDoubleDerivedAccessor = "";

		if( domainElement.GeneratesDoubleDerived )
		{
			name += "Base";
			modifier = "";
			constructorAccessor = "protected";
			classAccessor = " abstract";
		}
		
		if( domainElement.BaseElement != null )
		{
			baseClass = CodeGenerationUtilities.GetPropertyGridViewModelFullName(domainElement.BaseElement);	
		}
		
		if( domainElement.InheritanceModifier == InheritanceModifier.Abstract )
		{
			classAccessor = " abstract";
			classDoubleDerivedAccessor = " abstract";
		}
		
		DomainProperty nameProperty = CodeGenerationUtilities.GetNameProperty(domainElement);
		
		List<DomainProperty> createEditorForProperty = new List<DomainProperty>();
		List<DomainRole> createEditorForRole = new List<DomainRole>();
		

        
        #line default
        #line hidden
        
        #line 58 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t/// <summary>\r\n    /// Property grid view model for ");

        
        #line default
        #line hidden
        
        #line 60 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 60 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.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\ViewModel\PropertyGridViewModelGenerator.tt"

		if( domainElement.GeneratesDoubleDerived )
		{

        
        #line default
        #line hidden
        
        #line 64 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t///\r\n\t/// This is the base abstract class.\r\n");

        
        #line default
        #line hidden
        
        #line 67 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 69 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("    /// </summary>\r\n\tpublic");

        
        #line default
        #line hidden
        
        #line 71 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(classAccessor));

        
        #line default
        #line hidden
        
        #line 71 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(modifier));

        
        #line default
        #line hidden
        
        #line 71 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" class ");

        
        #line default
        #line hidden
        
        #line 71 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(name));

        
        #line default
        #line hidden
        
        #line 71 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" : ");

        
        #line default
        #line hidden
        
        #line 71 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(baseClass));

        
        #line default
        #line hidden
        
        #line 71 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t{\r\n\t\t#region Constructor\r\n        /// <summary>\r\n        /// Constructor.\r\n   " +
        "     /// </summary>\r\n\t\t/// <param name=\"viewModelStore\">The store this view mode" +
        "l belongs to.</param>\r\n        /// <param name=\"element\">Model element of type ");

        
        #line default
        #line hidden
        
        #line 78 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 78 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" for which this property grid view model is created.</param>\t\r\n\t\t[System.Diagnost" +
        "ics.CodeAnalysis.SuppressMessage(\"Microsoft.Usage\", \"CA2214:DoNotCallOverridable" +
        "MethodsInConstructors\")]\r\n\t\t");

        
        #line default
        #line hidden
        
        #line 80 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(constructorAccessor));

        
        #line default
        #line hidden
        
        #line 80 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" ");

        
        #line default
        #line hidden
        
        #line 80 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(name));

        
        #line default
        #line hidden
        
        #line 80 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("(DslEditorViewModelData::ViewModelStore viewModelStore, ");

        
        #line default
        #line hidden
        
        #line 80 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 80 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" element) : base(viewModelStore, element)\r\n\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 82 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		if( nameProperty != null )
		{

        
        #line default
        #line hidden
        
        #line 85 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\t// subscribe to ");

        
        #line default
        #line hidden
        
        #line 86 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 86 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 86 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameProperty.Name));

        
        #line default
        #line hidden
        
        #line 86 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" changes\r\n\t\t\tthis.EventManager.GetEvent<DslEditorViewModelEvents::ModelElementPro" +
        "pertyChangedEvent>().Subscribe(this.Store.DomainDataDirectory.GetDomainProperty(" +
        "");

        
        #line default
        #line hidden
        
        #line 87 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 87 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 87 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameProperty.Name));

        
        #line default
        #line hidden
        
        #line 87 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainPropertyId), this.Element.Id, new System.Action<DslModeling::ElementPropert" +
        "yChangedEventArgs>(");

        
        #line default
        #line hidden
        
        #line 87 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameProperty.Name));

        
        #line default
        #line hidden
        
        #line 87 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("PropertyChanged));\r\n\t\t\t\r\n\t\t\t// set name property value\r\n\t\t\tthis.elementFullNameSt" +
        "orage = element.");

        
        #line default
        #line hidden
        
        #line 90 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameProperty.Name));

        
        #line default
        #line hidden
        
        #line 90 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" + \" (");

        
        #line default
        #line hidden
        
        #line 90 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.DisplayName));

        
        #line default
        #line hidden
        
        #line 90 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(")\";\r\n");

        
        #line default
        #line hidden
        
        #line 91 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 93 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t}\r\n\t\t#endregion\r\n\t\t\r\n\t\t#region Properties\r\n");

        
        #line default
        #line hidden
        
        #line 98 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		if( nameProperty != null )
		{

        
        #line default
        #line hidden
        
        #line 101 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\tprivate void ");

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameProperty.Name));

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("PropertyChanged(DslModeling::ElementPropertyChangedEventArgs args)\r\n\t\t{\r\n\t\t\tif( a" +
        "rgs.NewValue != null )\r\n\t\t\t\tthis.ElementFullName = args.NewValue.ToString() + \" " +
        "(");

        
        #line default
        #line hidden
        
        #line 105 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.DisplayName));

        
        #line default
        #line hidden
        
        #line 105 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(")\";\r\n\t\t\telse\r\n\t\t\t\tthis.ElementFullName = \"");

        
        #line default
        #line hidden
        
        #line 107 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.DisplayName));

        
        #line default
        #line hidden
        
        #line 107 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\";\r\n\t\t}\r\n\r\n\t\tprivate string elementFullNameStorage = string.Empty;\r\n\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 112 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 114 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t/// <summary>\r\n        /// Gets or set the full name of the element, which prop" +
        "erties are to be added.\r\n        /// </summary>\r\n        public override string " +
        "ElementFullName \r\n\t\t{ \r\n");

        
        #line default
        #line hidden
        
        #line 120 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		if( nameProperty != null )
		{

        
        #line default
        #line hidden
        
        #line 123 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\tget\r\n\t\t\t{\r\n\t\t\t\treturn elementFullNameStorage;\r\n\t\t\t}\r\n\t\t\tset\r\n\t\t\t{\r\n\t\t\t\telement" +
        "FullNameStorage = value;\r\n\t\t\t\tOnPropertyChanged(\"ElementFullName\");\r\n\t\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 133 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}
		else
		{

        
        #line default
        #line hidden
        
        #line 137 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\tget{ return \"");

        
        #line default
        #line hidden
        
        #line 138 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.DisplayName));

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

        
        #line default
        #line hidden
        
        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 142 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t}\t\r\n\r\n\r\n        /// <summary>\r\n        /// Gets the description of the element," +
        " which properties are to be added.\r\n        /// </summary>\r\n        public overr" +
        "ide string ElementDescription \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 153 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 153 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"");

        
        #line default
        #line hidden
        
        #line 153 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.GetFullName(false)));

        
        #line default
        #line hidden
        
        #line 153 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(@".Description"");
			}
		}
		#endregion
		
		#region Methods
        /// <summary>
        /// Returns the collection of editor view models.
        /// </summary>
        /// <returns></returns>
        public override System.Collections.Generic.List<DslEditorViewModelPGrid::PropertyGridEditorViewModel> GetEditorViewModels()
		{
			System.Collections.Generic.List<DslEditorViewModelPGrid::PropertyGridEditorViewModel> collection = new System.Collections.Generic.List<DslEditorViewModelPGrid::PropertyGridEditorViewModel>();
");

        
        #line default
        #line hidden
        
        #line 166 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

	if( domainElement.BaseElement != null )
	{

        
        #line default
        #line hidden
        
        #line 169 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\tcollection = base.GetEditorViewModels();\r\n");

        
        #line default
        #line hidden
        
        #line 171 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

	}

        
        #line default
        #line hidden
        
        #line 173 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 175 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

	
		foreach(DomainProperty property in domainElement.Properties)
		{
			if( property.Type.PropertyGridEditor == null)
				continue;
			
			if( !property.IsBrowsable )
				continue;

			createEditorForProperty.Add(property);

        
        #line default
        #line hidden
        
        #line 186 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\tCreateEditorViewModelFor");

        
        #line default
        #line hidden
        
        #line 187 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

        
        #line default
        #line hidden
        
        #line 187 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("(collection);\r\n");

        
        #line default
        #line hidden
        
        #line 188 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

			
		}
		
		foreach(DomainRole role in domainElement.RolesPlayed)
		{
			if( !role.IsPropertyBrowsable || !role.IsPropertyGenerator)
				continue;
			
			if( role.Relationship is EmbeddingRelationship )
			{
				if( role.Relationship.Target.CustomPropertyGridEditor == null )
					continue;
				
				if( role.Relationship.Source != role)
					continue;

				//if( role.Relationship.Source.RolePlayer != domainElement)
				//	continue;
			}
			
			createEditorForRole.Add(role);

        
        #line default
        #line hidden
        
        #line 210 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\tCreateEditorViewModelFor");

        
        #line default
        #line hidden
        
        #line 211 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.PropertyName));

        
        #line default
        #line hidden
        
        #line 211 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("Role(collection);\r\n");

        
        #line default
        #line hidden
        
        #line 212 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}
		

        
        #line default
        #line hidden
        
        #line 215 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t\t\treturn collection;\r\n\t\t}\r\n\t\t#endregion\r\n");

        
        #line default
        #line hidden
        
        #line 220 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		if( createEditorForProperty.Count > 0 || createEditorForRole.Count > 0 )
		{

        
        #line default
        #line hidden
        
        #line 223 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t\t#region Editor Creation\r\n");

        
        #line default
        #line hidden
        
        #line 226 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

			foreach(DomainProperty property in createEditorForProperty)
			{
				string wpfPropertyEditor = property.Type.PropertyGridEditor.Namespace + "." + property.Type.PropertyGridEditor.Name;
				string resourceKey = domainElement.GetFullName(false)+"/"+property.Name;

        
        #line default
        #line hidden
        
        #line 231 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t/// <summary>\r\n\t\t/// Create property grid editor view model for ");

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t\t/// </summary>\r\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft" +
        ".Reliability\", \"CA2000:Dispose objects before losing scope\")]\r\n\t\tprotected virtu" +
        "al void CreateEditorViewModelFor");

        
        #line default
        #line hidden
        
        #line 236 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

        
        #line default
        #line hidden
        
        #line 236 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("(System.Collections.Generic.List<DslEditorViewModelPGrid::PropertyGridEditorViewM" +
        "odel> collection)\r\n\t\t{\r\n\t\t\t");

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(wpfPropertyEditor));

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" editor = new ");

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(wpfPropertyEditor));

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("(this.ViewModelStore");

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
 if(property.Type is DomainEnumeration){
        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" , typeof(");

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Type.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("), ");

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture((property.Type as DomainEnumeration).IsFlags.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
 } 
        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(");\r\n\t\t\t\r\n            editor.PropertyName = \"");

        
        #line default
        #line hidden
        
        #line 240 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));

        
        #line default
        #line hidden
        
        #line 240 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\";\r\n\t\t\teditor.PropertyDisplayName = ");

        
        #line default
        #line hidden
        
        #line 241 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 241 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"");

        
        #line default
        #line hidden
        
        #line 241 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resourceKey));

        
        #line default
        #line hidden
        
        #line 241 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".DisplayName\");\r\n\t\t\teditor.PropertyDescription = ");

        
        #line default
        #line hidden
        
        #line 242 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 242 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"");

        
        #line default
        #line hidden
        
        #line 242 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resourceKey));

        
        #line default
        #line hidden
        
        #line 242 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".Description\");\r\n\t\t\teditor.PropertyCategory = \"");

        
        #line default
        #line hidden
        
        #line 243 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Category));

        
        #line default
        #line hidden
        
        #line 243 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\";\r\n\t\t\teditor.IsPropertyRequired = ");

        
        #line default
        #line hidden
        
        #line 244 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.IsRequired.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 244 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(";\r\n\t\t\teditor.IsPropertyReadOnly = ");

        
        #line default
        #line hidden
        
        #line 245 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.IsUIReadOnly.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 245 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(";\t\t\r\n\t\t\t\t\r\n\t\t\tcollection.Add(editor);\r\n\t\t}\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\ViewModel\PropertyGridViewModelGenerator.tt"

			}
			
			foreach(DomainRole role in createEditorForRole)
			{
				string resourceKey = role.Relationship.GetFullName(false)+"/"+role.Opposite.Name;
				string resourcePropertyKey = role.Relationship.GetFullName(false)+"/"+role.Name;
				
				bool bIsRequired = false;
				if( role.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.OneMany || role.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.One )
					bIsRequired = true;		
				
				if( role.Relationship.Target.CustomPropertyGridEditor != null )
				{
					if( role.Relationship.Target.CustomPropertyGridEditor.Name == "ReferencedModelRoleViewModel" && 
						role.Relationship.Target.CustomPropertyGridEditor.Namespace == "Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions.Path" )
					{						
						if( role.Relationship.Source != role)
							continue;

        
        #line default
        #line hidden
        
        #line 269 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t/// <summary>\r\n\t\t/// Create property grid editor view model for ");

        
        #line default
        #line hidden
        
        #line 271 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 271 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 271 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.PropertyName));

        
        #line default
        #line hidden
        
        #line 271 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t\t/// </summary>\r\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft" +
        ".Reliability\", \"CA2000:Dispose objects before losing scope\")]\r\n\t\tprotected virtu" +
        "al void CreateEditorViewModelFor");

        
        #line default
        #line hidden
        
        #line 274 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.PropertyName));

        
        #line default
        #line hidden
        
        #line 274 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("Role(System.Collections.Generic.List<DslEditorViewModelPGrid::PropertyGridEditorV" +
        "iewModel> collection)\r\n\t\t{\r\n\t\t\t");

        
        #line default
        #line hidden
        
        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Relationship.Name));

        
        #line default
        #line hidden
        
        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Relationship.Target.Name));

        
        #line default
        #line hidden
        
        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("RMRViewModel editor = new ");

        
        #line default
        #line hidden
        
        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Relationship.Name));

        
        #line default
        #line hidden
        
        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Relationship.Target.Name));

        
        #line default
        #line hidden
        
        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("RMRViewModel(this.ViewModelStore);\r\n\t\t\t\r\n\t\t\teditor.PropertyName = \"");

        
        #line default
        #line hidden
        
        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.PropertyName));

        
        #line default
        #line hidden
        
        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\";\r\n\t\t\teditor.PropertyDisplayName = ");

        
        #line default
        #line hidden
        
        #line 279 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 279 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"");

        
        #line default
        #line hidden
        
        #line 279 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resourcePropertyKey));

        
        #line default
        #line hidden
        
        #line 279 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".PropertyDisplayName\");\r\n\t\t\teditor.PropertyDescription = ");

        
        #line default
        #line hidden
        
        #line 280 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 280 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"");

        
        #line default
        #line hidden
        
        #line 280 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resourceKey));

        
        #line default
        #line hidden
        
        #line 280 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".Description\");\r\n\t\t\teditor.PropertyCategory = \"");

        
        #line default
        #line hidden
        
        #line 281 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Opposite.Category));

        
        #line default
        #line hidden
        
        #line 281 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\";\r\n\t\t\teditor.IsPropertyRequired = ");

        
        #line default
        #line hidden
        
        #line 282 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(bIsRequired.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 282 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(";\r\n\t\t\teditor.IsPropertyReadOnly = false;\r\n\t\t\r\n\t\t\tcollection.Add(editor);\r\n\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 287 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

						
						continue;
					}
					
				}
				
				string wpfPropertyEditor = "Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.PropertyGrid.UnaryRoleEditorViewModel";
				
				if( role.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.OneMany || role.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.ZeroMany )
					wpfPropertyEditor = "Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.PropertyGrid.MultipleRoleEditorViewModel";
				
				if( role.CustomPropertyGridEditor != null)
					wpfPropertyEditor = role.CustomPropertyGridEditor.Namespace + "." + role.CustomPropertyGridEditor.Name;
				
				bool bIsReadOnly = role.IsPropertyUIReadOnly;
				if( !(role.Opposite.RolePlayer is DomainClass) )
					bIsReadOnly = true;

        
        #line default
        #line hidden
        
        #line 305 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t/// <summary>\r\n\t\t/// Create property grid editor view model for ");

        
        #line default
        #line hidden
        
        #line 307 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 307 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 307 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.PropertyName));

        
        #line default
        #line hidden
        
        #line 307 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t\t/// </summary>\r\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft" +
        ".Reliability\", \"CA2000:Dispose objects before losing scope\")]\r\n\t\tprotected virtu" +
        "al void CreateEditorViewModelFor");

        
        #line default
        #line hidden
        
        #line 310 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.PropertyName));

        
        #line default
        #line hidden
        
        #line 310 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("Role(System.Collections.Generic.List<DslEditorViewModelPGrid::PropertyGridEditorV" +
        "iewModel> collection)\r\n\t\t{\r\n\t\t\t");

        
        #line default
        #line hidden
        
        #line 312 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(wpfPropertyEditor));

        
        #line default
        #line hidden
        
        #line 312 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" editor = new ");

        
        #line default
        #line hidden
        
        #line 312 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(wpfPropertyEditor));

        
        #line default
        #line hidden
        
        #line 312 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("(this.ViewModelStore, \r\n\t\t\t\t\t\t\t\t\tthis.Store.DomainDataDirectory.GetDomainRelation" +
        "ship(");

        
        #line default
        #line hidden
        
        #line 313 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Relationship.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 313 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".DomainClassId),\r\n\t\t\t\t\t   \t\t\t\t");

        
        #line default
        #line hidden
        
        #line 314 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Relationship.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 314 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 314 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Name));

        
        #line default
        #line hidden
        
        #line 314 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainRoleId);\r\n\t\t\t\r\n\t\t\teditor.PropertyName = \"");

        
        #line default
        #line hidden
        
        #line 316 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.PropertyName));

        
        #line default
        #line hidden
        
        #line 316 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\";\r\n\t\t\teditor.PropertyDisplayName = ");

        
        #line default
        #line hidden
        
        #line 317 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 317 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"");

        
        #line default
        #line hidden
        
        #line 317 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resourcePropertyKey));

        
        #line default
        #line hidden
        
        #line 317 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".PropertyDisplayName\");\r\n\t\t\teditor.PropertyDescription = ");

        
        #line default
        #line hidden
        
        #line 318 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 318 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"");

        
        #line default
        #line hidden
        
        #line 318 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resourceKey));

        
        #line default
        #line hidden
        
        #line 318 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".Description\");\r\n\t\t\teditor.PropertyCategory = \"");

        
        #line default
        #line hidden
        
        #line 319 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Opposite.Category));

        
        #line default
        #line hidden
        
        #line 319 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\";\r\n\t\t\teditor.IsPropertyRequired = ");

        
        #line default
        #line hidden
        
        #line 320 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(bIsRequired.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 320 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(";\r\n\t\t\teditor.IsPropertyReadOnly = ");

        
        #line default
        #line hidden
        
        #line 321 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(bIsReadOnly.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 321 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(";\t\t\t\r\n\t\t\r\n\t\t\tcollection.Add(editor);\r\n\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 325 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

			}

        
        #line default
        #line hidden
        
        #line 327 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\t\t\r\n\t\t#endregion\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 329 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}
		if( nameProperty != null )
		{

        
        #line default
        #line hidden
        
        #line 333 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t\t#region Dispose\r\n\t\t/// <summary>\r\n\t\t/// Unregister from events although they " +
        "are weak.\r\n\t\t/// </summary>\r\n\t\tprotected override void OnDispose()\r\n\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 341 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

			if( nameProperty != null )
			{

        
        #line default
        #line hidden
        
        #line 344 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\tthis.EventManager.GetEvent<DslEditorViewModelEvents::ModelElementPropertyChang" +
        "edEvent>().Unsubscribe(this.Store.DomainDataDirectory.GetDomainProperty(");

        
        #line default
        #line hidden
        
        #line 345 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 345 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 345 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameProperty.Name));

        
        #line default
        #line hidden
        
        #line 345 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("DomainPropertyId), this.Element.Id, new System.Action<DslModeling::ElementPropert" +
        "yChangedEventArgs>(");

        
        #line default
        #line hidden
        
        #line 345 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameProperty.Name));

        
        #line default
        #line hidden
        
        #line 345 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("PropertyChanged));\r\n");

        
        #line default
        #line hidden
        
        #line 346 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

			}

        
        #line default
        #line hidden
        
        #line 348 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t\t\tbase.OnDispose();\r\n\t\t}\r\n\t\t#endregion\r\n");

        
        #line default
        #line hidden
        
        #line 352 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 354 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\t}\r\n");

        
        #line default
        #line hidden
        
        #line 356 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		if( domainElement.GeneratesDoubleDerived )
		{

        
        #line default
        #line hidden
        
        #line 359 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t/// <summary>\r\n    /// Property grid view model for ");

        
        #line default
        #line hidden
        
        #line 362 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 362 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t///\r\n\t///\tThis is the double generated class for easier customization.\r\n\t/// <" +
        "/summary>\r\n\tpublic");

        
        #line default
        #line hidden
        
        #line 366 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(classDoubleDerivedAccessor));

        
        #line default
        #line hidden
        
        #line 366 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" partial class PropertyGrid");

        
        #line default
        #line hidden
        
        #line 366 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 366 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("ViewModel : ");

        
        #line default
        #line hidden
        
        #line 366 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(name));

        
        #line default
        #line hidden
        
        #line 366 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("\r\n\t{\r\n\t\t#region Constructor\r\n        /// <summary>\r\n        /// Constructor.\r\n   " +
        "     /// </summary>\r\n\t\t/// <param name=\"viewModelStore\">The store this view mode" +
        "l belongs to.</param>\r\n        /// <param name=\"element\">Model element of type ");

        
        #line default
        #line hidden
        
        #line 373 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 373 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" for which this property grid view model is created.</param>\t\t\r\n\t\tpublic Property" +
        "Grid");

        
        #line default
        #line hidden
        
        #line 374 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.Name));

        
        #line default
        #line hidden
        
        #line 374 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write("ViewModel(DslEditorViewModelData::ViewModelStore viewModelStore, ");

        
        #line default
        #line hidden
        
        #line 374 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainElement.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 374 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"
this.Write(" element) : base(viewModelStore, element)\r\n\t\t{\r\n\t\t\t\r\n\t\t}\r\n\t\t#endregion\r\n\t}\r\n");

        
        #line default
        #line hidden
        
        #line 380 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\PropertyGridViewModelGenerator.tt"

		}
}
Ejemplo n.º 18
0
        public static void PostProcessModelLoad(MetaModel model)
        {
            // package and custom editor GUIDs
            if (model.PackageGuid == null || model.PackageGuid == Guid.Empty)
            {
                model.PackageGuid = Guid.NewGuid();
            }
            if (model.CustomExtensionGuid == null || model.CustomExtensionGuid == Guid.Empty)
            {
                model.CustomExtensionGuid = Guid.NewGuid();
            }


            #region relationship targets fixup
            ReadOnlyCollection <DomainRelationship> rels = model.AllRelationships;
            foreach (DomainRelationship rel in rels)
            {
                if (rel.Target.RolePlayer == null)
                {
                    ReferenceRelationship referenceRelationship = rel as ReferenceRelationship;
                    if (referenceRelationship != null)
                    {
                        if (referenceRelationship.ReferenceRSNode != null)
                        {
                            referenceRelationship.ReferenceRSNode.Delete();
                        }

                        if (referenceRelationship.SerializedReferenceRelationship != null)
                        {
                            referenceRelationship.SerializedReferenceRelationship.Delete();
                        }
                    }

                    EmbeddingRelationship embeddingRelationship = rel as EmbeddingRelationship;
                    if (embeddingRelationship != null)
                    {
                        if (embeddingRelationship.EmbeddingRSNode != null)
                        {
                            embeddingRelationship.EmbeddingRSNode.Delete();
                        }

                        if (embeddingRelationship.SerializedEmbeddingRelationship != null)
                        {
                            embeddingRelationship.SerializedEmbeddingRelationship.Delete();
                        }
                    }

                    rel.Delete();
                }
            }
            #endregion

            #region inconsistent serialization elements
            foreach (BaseModelContext context in model.ModelContexts)
            {
                if (context is LibraryModelContext)
                {
                    LibraryModelContext lib = context as LibraryModelContext;
                    if (lib.SerializationModel != null)
                    {
                        for (int i = lib.SerializationModel.Children.Count - 1; i >= 0; i--)
                        {
                            SerializationClass c = lib.SerializationModel.Children[i];
                            if (c is SerializedDomainClass)
                            {
                                SerializedDomainClass s = c as SerializedDomainClass;
                                if (s.DomainClass == null)
                                {
                                    s.Delete();
                                }

                                continue;
                            }
                            else if (c is SerializedEmbeddingRelationship)
                            {
                                SerializedEmbeddingRelationship s = c as SerializedEmbeddingRelationship;
                                if (s.EmbeddingRelationship == null)
                                {
                                    s.Delete();
                                }

                                continue;
                            }
                            else if (c is SerializedReferenceRelationship)
                            {
                                SerializedReferenceRelationship s = c as SerializedReferenceRelationship;
                                if (s.ReferenceRelationship == null)
                                {
                                    s.Delete();
                                }

                                continue;
                            }

                            // element has not been deleted, see if its properties are ok
                            for (int y = c.Properties.Count - 1; y >= 0; y--)
                            {
                                if (c.Properties[y] == null)
                                {
                                    c.Properties[y].Delete();
                                }
                            }
                        }
                    }
                }
            }
            #endregion

            #region derived classes serialization items fixup
            if (model.MetaModelLibraries.Count > 0)
            {
                ReadOnlyCollection <ModelElement> elements = model.Store.ElementDirectory.FindElements(DomainClassReferencesBaseClass.DomainClassId);
                foreach (ModelElement m in elements)
                {
                    DomainClassReferencesBaseClass con = m as DomainClassReferencesBaseClass;
                    if (con != null)
                    {
                        if (con.BaseClass != null)
                        {
                            if (con.BaseClass.ModelContext.MetaModel != model)
                            {
                                foreach (DomainClass derivedClass in con.BaseClass.DerivedClasses)
                                {
                                    FixUpDerivedClasses(derivedClass, model);
                                }
                            }
                        }
                    }
                }

                ReadOnlyCollection <ModelElement> elementsCon = model.Store.ElementDirectory.FindElements(DomainRelationshipReferencesBaseRelationship.DomainClassId);
                foreach (ModelElement m in elementsCon)
                {
                    DomainRelationshipReferencesBaseRelationship con = m as DomainRelationshipReferencesBaseRelationship;
                    if (con != null)
                    {
                        if (con.BaseRelationship != null)
                        {
                            if (con.BaseRelationship.ModelContext.MetaModel != model)
                            {
                                foreach (DomainRelationship derivedClass in con.BaseRelationship.DerivedRelationships)
                                {
                                    FixUpDerivedRelationships(derivedClass, model);
                                }
                            }
                        }
                    }
                }
            }
            #endregion

            #region check if model contains all required elements
            // property grid editors
            if (model.PropertyGridEditors.Count == 0)
            {
                FixUpPropertyGridEditors(model);
            }

            // domain types
            if (model.DomainTypes.Count == 0)
            {
                FixUpDomainTypes(model);
            }

            // model context
            if (model.ModelContexts.Count == 0)
            {
                FixUpModelContext(model);
            }

            // validation
            if (model.Validation == null)
            {
                model.Validation = new Validation(model.Store);
            }

            if (model.View == null)
            {
                model.View = new View(model.Store);
            }

            if (model.View.ModelTree == null)
            {
                model.View.ModelTree = new ModelTree(model.Store);
            }

            foreach (BaseModelContext mContext in model.ModelContexts)
            {
                if (mContext is LibraryModelContext)
                {
                    LibraryModelContext m = mContext as LibraryModelContext;
                    if (m.DiagramClasses.Count == 0 && m is ModelContext)
                    {
                        DesignerDiagramClass ddC = new DesignerDiagramClass(model.Store);
                        ddC.Name  = "DesignerDiagram";
                        ddC.Title = "Designer";

                        m.DiagramClasses.Add(ddC);
                    }

                    if (m.ViewContext == null)
                    {
                        m.ViewContext = new ViewContext(model.Store);
                        m.ViewContext.DomainModelTreeView = new DomainModelTreeView(model.Store);
                        m.ViewContext.DiagramView         = new DiagramView(model.Store);

                        model.View.ViewContexts.Add(m.ViewContext);

                        FixUpDomainModelTreeView(m);
                        FixUpDiagramView(m);
                    }

                    if (m.ViewContext.DiagramView == null || m.ViewContext.DomainModelTreeView == null)
                    {
                        if (m.ViewContext.DomainModelTreeView == null)
                        {
                            m.ViewContext.DomainModelTreeView = new DomainModelTreeView(model.Store);
                            FixUpDomainModelTreeView(m);
                        }

                        if (m.ViewContext.DiagramView == null)
                        {
                            m.ViewContext.DiagramView = new DiagramView(model.Store);
                            FixUpDiagramView(m);
                        }
                    }

                    // diagram class view for designer diagram
                    if (m.ViewContext.DiagramView.DiagramClassViews.Count == 0 && m is ModelContext)
                    {
                        DiagramClassView vm = new DiagramClassView(model.Store);
                        vm.IsExpanded = true;
                        foreach (DiagramClass d in m.DiagramClasses)
                        {
                            if (d is DesignerDiagramClass)
                            {
                                vm.DiagramClass = d;
                                break;
                            }
                        }

                        m.ViewContext.DiagramView.DiagramClassViews.Add(vm);
                    }

                    // serialization
                    if (m.SerializationModel == null)
                    {
                        m.SerializationModel = new SerializationModel(model.Store);
                    }

                    // serialized domain model
                    if (m is ModelContext)
                    {
                        if (m.SerializationModel.SerializedDomainModel == null)
                        {
                            FixUpSerializedDomainModel(m as ModelContext);
                        }
                    }
                }
            }
            #endregion

            // view ids.
            if (model.View != null)
            {
                if (model.View.ModelTreeId == null || model.View.ModelTreeId == Guid.Empty)
                {
                    model.View.ModelTreeId = Guid.NewGuid();
                }

                if (model.View.DependenciesViewId == null || model.View.DependenciesViewId == Guid.Empty)
                {
                    model.View.DependenciesViewId = Guid.NewGuid();
                }

                if (model.View.ErrorListId == null || model.View.ErrorListId == Guid.Empty)
                {
                    model.View.ErrorListId = Guid.NewGuid();
                }

                if (model.View.PropertyGridId == null || model.View.PropertyGridId == Guid.Empty)
                {
                    model.View.PropertyGridId = Guid.NewGuid();
                }

                if (model.View.SearchId == null || model.View.SearchId == Guid.Empty)
                {
                    model.View.SearchId = Guid.NewGuid();
                }

                if (model.View.SearchResultId == null || model.View.SearchResultId == Guid.Empty)
                {
                    model.View.SearchResultId = Guid.NewGuid();
                }

                if (model.View.PluginWindowId == null || model.View.PluginWindowId == Guid.Empty)
                {
                    model.View.PluginWindowId = Guid.NewGuid();
                }
            }
        }
private void CreateConstructor(MetaModel dm, DiagramClass diagramClass, bool isBaseAbstractClass)
{
	string accessor = "public";
	string name = dm.Name + diagramClass.Name + "SurfaceViewModel";
	if( isBaseAbstractClass )
	{
		accessor = "protected";
		name += "Base";
	}
	
	
	if( diagramClass is ModalDiagram)
	{

        
        #line default
        #line hidden
        
        #line 336 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("/// <summary>\r\n/// Constuctor.\r\n/// </summary>\r\n/// <param name=\"viewModelStore\">" +
        "The store this view model belongs to.</param>\r\n/// <param name=\"element\">Element" +
        ".</param>\r\n");

        
        #line default
        #line hidden
        
        #line 342 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(accessor));

        
        #line default
        #line hidden
        
        #line 342 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(" ");

        
        #line default
        #line hidden
        
        #line 342 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(name));

        
        #line default
        #line hidden
        
        #line 342 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("(DslEditorViewModels.Data.ViewModelStore viewModelStore, DslEditorModeling::Domai" +
        "nModelElement element)\r\n    : base(viewModelStore, element)\r\n{\r\n\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 347 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

	}
	else if( diagramClass is SpecificElementsDiagram)
	{

        
        #line default
        #line hidden
        
        #line 351 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("/// <summary>\r\n/// Constuctor.\r\n/// </summary>\r\n/// <param name=\"viewModelStore\">" +
        "The store this view model belongs to.</param>\r\n/// <param name=\"modelContext\">Mo" +
        "del context.</param>\r\n");

        
        #line default
        #line hidden
        
        #line 357 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(accessor));

        
        #line default
        #line hidden
        
        #line 357 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(" ");

        
        #line default
        #line hidden
        
        #line 357 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(name));

        
        #line default
        #line hidden
        
        #line 357 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(@"(DslEditorViewModels.Data.ViewModelStore viewModelStore, DslEditorModeling::ModelContext modelContext)
    : base(viewModelStore, modelContext)
{
}

/// <summary>
/// Constuctor.
/// </summary>
/// <param name=""viewModelStore"">The store this view model belongs to.</param>
/// <param name=""modelContextName"">Model context name.</param>
");

        
        #line default
        #line hidden
        
        #line 367 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(accessor));

        
        #line default
        #line hidden
        
        #line 367 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(" ");

        
        #line default
        #line hidden
        
        #line 367 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(name));

        
        #line default
        #line hidden
        
        #line 367 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("(DslEditorViewModels.Data.ViewModelStore viewModelStore, string modelContextName)" +
        "\r\n    : base(viewModelStore, modelContextName)\r\n{\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 371 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

	}
	else if( diagramClass is DesignerSurfaceDiagram)
	{

        
        #line default
        #line hidden
        
        #line 377 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

	}

	if( diagramClass is RestorableChildlessDiagram || diagramClass is RestorableTemplatedDiagramVMOnly)
	{

        
        #line default
        #line hidden
        
        #line 382 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("/// <summary>\r\n/// Constuctor.\r\n/// </summary>\r\n/// <param name=\"viewModelStore\">" +
        "The store this view model belongs to.</param>\r\n");

        
        #line default
        #line hidden
        
        #line 387 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(accessor));

        
        #line default
        #line hidden
        
        #line 387 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(" ");

        
        #line default
        #line hidden
        
        #line 387 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(name));

        
        #line default
        #line hidden
        
        #line 387 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("(DslEditorViewModels.Data.ViewModelStore viewModelStore)\r\n    : base(viewModelSto" +
        "re)\r\n{\r\n\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 392 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

	}
}
Ejemplo n.º 20
0
        private static void FixUpDerivedRelationships(DomainRelationship domainClass, MetaModel model)
        {
            if (domainClass.ModelContext.MetaModel == model)
            {
                if (domainClass is EmbeddingRelationship)
                {
                    EmbeddingRelationship con = domainClass as EmbeddingRelationship;
                    SerializationHelper.UpdateSerializationDomainProperties(domainClass.Store, con.SerializedEmbeddingRelationship, domainClass);
                }

                if (domainClass is ReferenceRelationship)
                {
                    ReferenceRelationship con = domainClass as ReferenceRelationship;
                    SerializationHelper.UpdateSerializationDomainProperties(domainClass.Store, con.SerializedReferenceRelationship, domainClass);
                }
            }

            foreach (DomainRelationship derivedClass in domainClass.DerivedRelationships)
            {
                FixUpDerivedRelationships(derivedClass, model);
            }
        }
private void GenerateDiagramViewModelInternal(MetaModel dm, DiagramClass diagramClass)
{
	string baseClass = "DslEditorViewDiagrams::BaseDiagramSurfaceViewModel";	
	if( diagramClass is SpecificElementsDiagram)
	{
		if( (diagramClass as SpecificElementsDiagram).DomainClasses.Count == 0 )
			return;
		
		baseClass = "DslEditorViewDiagrams.Templates.SpecificElementsDesignerSurfaceViewModel";
	}
	else if( diagramClass is DesignerSurfaceDiagram)
	{
		baseClass = "DslEditorViewDiagrams.Templates.DesignerSurfaceViewModel";
	}
	else if( diagramClass is ModalDiagram)
	{
		if( (diagramClass as ModalDiagram).DomainClass == null )
			return;
		
		baseClass = "DslEditorViewDiagrams.Templates.ModalDesignerSurfaceViewModel";
	}

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\r\nnamespace ");

        
        #line default
        #line hidden
        
        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

        
        #line default
        #line hidden
        
        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(".ViewModel\r\n{\r\n\t/// <summary>\r\n\t/// This class represents the default diagram sur" +
        "face view model of the ");

        
        #line default
        #line hidden
        
        #line 43 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.ApplicationName));

        
        #line default
        #line hidden
        
        #line 43 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(".\r\n\t/// \r\n\t/// Double-derived class to allow easier code customization.\r\n\t/// </s" +
        "ummary>\r\n\tpublic partial class ");

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Name));

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("SurfaceViewModel : ");

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Name));

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("SurfaceViewModelBase\r\n\t{\r\n\t\t#region Constructor\r\n");

        
        #line default
        #line hidden
        
        #line 50 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

		this.PushIndent("\t\t");
		CreateConstructor(dm, diagramClass, false);
		this.PopIndent();

        
        #line default
        #line hidden
        
        #line 54 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\r\n\t\t#endregion\r\n\t}\r\n\t\r\n\t/// <summary>\r\n\t/// This class represents the default di" +
        "agram surface view model of the ");

        
        #line default
        #line hidden
        
        #line 59 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.ApplicationName));

        
        #line default
        #line hidden
        
        #line 59 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(".\r\n\t/// \r\n\t/// This is the abstract base class.\r\n\t/// </summary>\r\n\tpublic abstrac" +
        "t partial class ");

        
        #line default
        #line hidden
        
        #line 63 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 63 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Name));

        
        #line default
        #line hidden
        
        #line 63 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("SurfaceViewModelBase : ");

        
        #line default
        #line hidden
        
        #line 63 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(baseClass));

        
        #line default
        #line hidden
        
        #line 63 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\r\n\t{\r\n\t\t#region Constructor\r\n");

        
        #line default
        #line hidden
        
        #line 66 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

		this.PushIndent("\t\t");
		CreateConstructor(dm, diagramClass, true);
		this.PopIndent();

        
        #line default
        #line hidden
        
        #line 70 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\r\n\t\t#endregion\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 72 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
	
		if( diagramClass is ModalDiagram)
		{
			ModalDiagram diagram = diagramClass as ModalDiagram;

        
        #line default
        #line hidden
        
        #line 76 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t#region ModalDiagram\r\n\t\t/// <summary>\r\n        /// Unique name of the property " +
        "grid docking window.\r\n        /// </summary>\r\n        public override string Doc" +
        "kingPaneName\r\n        {\r\n            get { return \"");

        
        #line default
        #line hidden
        
        #line 83 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Name));

        
        #line default
        #line hidden
        
        #line 83 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("SurfaceDockWindowPane\" + this.NameExtension; }\r\n        }\r\n\r\n        /// <summary" +
        ">\r\n        /// Title of the docking windo.\r\n        /// </summary>\r\n        publ" +
        "ic override string DockingPaneTitle\r\n        {\r\n            get { return \"");

        
        #line default
        #line hidden
        
        #line 91 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Title));

        
        #line default
        #line hidden
        
        #line 91 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\" + this.TitleExtension; }\r\n        }\t\t\r\n\t\t\r\n        /// <summary>\r\n        /// I" +
        "nitialization routine.\r\n        /// </summary>\r\n        protected override void " +
        "Initialize()\r\n        {\r\n            base.Initialize();\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 101 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

				if(diagram.DomainClass.GenerateSpecificViewModel )
				{
					string dClass = diagram.DomainClass.GetMetaModel().Namespace + ".ViewModel." + diagram.DomainClass.Name + "SpecificViewModel";

        
        #line default
        #line hidden
        
        #line 105 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t\tthis.HostedElementVM = new ");

        
        #line default
        #line hidden
        
        #line 106 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dClass));

        
        #line default
        #line hidden
        
        #line 106 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("(this.ViewModelStore, (this.HostedElement as ");

        
        #line default
        #line hidden
        
        #line 106 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.DomainClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 106 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("));\r\n");

        
        #line default
        #line hidden
        
        #line 107 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

				}
				else
				{

        
        #line default
        #line hidden
        
        #line 111 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t\tthis.HostedElementVM = new DslEditorViewModels::BaseModelElementViewModel(this" +
        ".ViewModelStore, this.HostedElement, true);\r\n");

        
        #line default
        #line hidden
        
        #line 113 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
					
				}

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

        
        #line default
        #line hidden
        
        #line 118 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

		}
		else if( diagramClass is SpecificElementsDiagram)
		{
			SpecificElementsDiagram diagram = diagramClass as SpecificElementsDiagram;

        
        #line default
        #line hidden
        
        #line 123 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(@"
		#region SpecificElementsDiagram		
		private SelectedElementEnum selectedElementEnum = SelectedElementEnum.___None___;
		
		/// <summary>
		/// Enumeration identifying the currently selected element type.
		/// </summary>
		public enum SelectedElementEnum
		{
			___None___,
");

        
        #line default
        #line hidden
        
        #line 134 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

			foreach(DomainClass d in diagram.DomainClasses)
			{

        
        #line default
        #line hidden
        
        #line 137 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t\t");

        
        #line default
        #line hidden
        
        #line 138 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.Name));

        
        #line default
        #line hidden
        
        #line 138 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(",\r\n");

        
        #line default
        #line hidden
        
        #line 139 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

			}

        
        #line default
        #line hidden
        
        #line 141 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t}\r\n\t\t\r\n\t\t/// <summary>\r\n\t\t/// Gets the selected element type.\r\n\t\t/// </summary>" +
        "\r\n\t\tpublic SelectedElementEnum SelectedElementType\r\n\t\t{\r\n\t\t\tget\r\n\t\t\t{\r\n\t\t\t\tretur" +
        "n this.selectedElementEnum;\r\n\t\t\t}\r\n\t\t\tprivate set\r\n\t\t\t{\r\n\t\t\t\tif( this.selectedEl" +
        "ementEnum != value )\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.selectedElementEnum = value;\r\n\t\t\t\t\tOnProp" +
        "ertyChanged(\"SelectedElementType\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/// <summary>\r\n    " +
        "    /// Called if the hosted element was deleted.\r\n        /// </summary>\r\n     " +
        "   /// <param name=\"args\">Data</param>\r\n        protected override void OnHosted" +
        "ElementDeleted(DslModeling::ElementDeletedEventArgs args)\r\n        {\r\n          " +
        "  base.OnHostedElementDeleted(args);\r\n\t\t\t\r\n\t\t\tthis.SelectedElementType = Selecte" +
        "dElementEnum.___None___;\r\n        }\r\n\t\t\r\n        /// <summary>\r\n        /// Call" +
        "back from SelectionChangedEvent.\r\n        /// </summary>\r\n        /// <param nam" +
        "e=\"eventArgs\">SelectionChangedEventArgs.</param>\r\n        protected override voi" +
        "d ReactOnViewSelection(DslEditorEvents::SelectionChangedEventArgs eventArgs)\r\n  " +
        "      {\r\n\t\t\tbase.ReactOnViewSelection(eventArgs);\r\n\r\n\t\t\t// update selection\r\n   " +
        "         if (this.IsInitialized && this.IsDockingPaneVisible)\r\n\t\t\t\tDslEditorView" +
        "Models.Threading.DispatcherExtensions.InvokeAsynchronouslyInBackground(\r\n       " +
        "            System.Windows.Threading.Dispatcher.CurrentDispatcher, new System.Ac" +
        "tion(UpdateView));\r\n        }\r\n\t\t\t\t\r\n        /// <summary>\r\n        /// Initiali" +
        "ze.\r\n        /// </summary>\r\n        protected override void Initialize()\r\n     " +
        "   {\r\n            base.Initialize();\r\n\r\n            if (this.SelectedItemsCollec" +
        "tion != null)\r\n\t\t\t\tDslEditorViewModels.Threading.DispatcherExtensions.InvokeAsyn" +
        "chronouslyInBackground(\r\n                   System.Windows.Threading.Dispatcher." +
        "CurrentDispatcher, new System.Action(UpdateView));\r\n        }\r\n\t\t\r\n\t\t/// <summar" +
        "y>\r\n        /// Updates the view based on the current selection.\r\n        /// </" +
        "summary>\r\n\t\tprotected virtual void UpdateView()\r\n\t\t{\r\n\t\t\tif( this.SelectedItemsC" +
        "ollection.Count != 1 )\r\n\t\t\t\treturn;\r\n\t\t\t\t\r\n\t\t\tDslEditorModeling::DomainModelElem" +
        "ent element = this.SelectedItemsCollection[0] as DslEditorModeling::DomainModelE" +
        "lement;\r\n\t\t\tif( element != null )\r\n\t\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 211 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

			foreach(DomainClass d in diagram.DomainClasses)
			{

        
        #line default
        #line hidden
        
        #line 214 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t\t\tif( element is ");

        
        #line default
        #line hidden
        
        #line 215 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 215 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(" )\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.SelectedElementType = SelectedElementEnum.");

        
        #line default
        #line hidden
        
        #line 217 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.Name));

        
        #line default
        #line hidden
        
        #line 217 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(";\r\n");

        
        #line default
        #line hidden
        
        #line 218 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

				if(d.GenerateSpecificViewModel )
				{
					string dClass = d.GetMetaModel().Namespace + ".ViewModel." + d.Name + "SpecificViewModel";

        
        #line default
        #line hidden
        
        #line 222 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t\t\t\tif( HostedElement != null )\r\n\t\t\t\t\t\tif( HostedElement.Element.Id == element.I" +
        "d )\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\tHostedElement = new ");

        
        #line default
        #line hidden
        
        #line 227 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dClass));

        
        #line default
        #line hidden
        
        #line 227 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("(this.ViewModelStore, (element as ");

        
        #line default
        #line hidden
        
        #line 227 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 227 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("));\r\n");

        
        #line default
        #line hidden
        
        #line 228 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

				}
				else
				{

        
        #line default
        #line hidden
        
        #line 232 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t\t\t\tHostedElement = new DslEditorViewModels::BaseModelElementViewModel(this.View" +
        "ModelStore, element, true);\r\n");

        
        #line default
        #line hidden
        
        #line 234 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
					
				}

        
        #line default
        #line hidden
        
        #line 236 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t\t\t\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 240 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

			}

        
        #line default
        #line hidden
        
        #line 242 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(@"			}
		}
		
		/// <summary>
        /// Reset.
        /// </summary>
        protected override void Reset()
        {
			this.SelectedElementType = SelectedElementEnum.___None___;
			
			base.Reset();
		}
		
		 /// <summary>
        /// Visibility changed.
        /// </summary>
        /// <param name=""bVisible""></param>
        protected override void OnVisibilityChanged(bool bVisible)
        {
            base.OnVisibilityChanged(bVisible);

            if (this.IsDockingPaneVisible && this.IsInitialized)
				if (this.SelectedItemsCollection != null)
					DslEditorViewModels.Threading.DispatcherExtensions.InvokeAsynchronouslyInBackground(
                   		System.Windows.Threading.Dispatcher.CurrentDispatcher, new System.Action(UpdateView));
        }
		#endregion
		
");

        
        #line default
        #line hidden
        
        #line 271 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

		}
		else if( diagramClass is DesignerSurfaceDiagram)
		{

        
        #line default
        #line hidden
        
        #line 275 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t#region DesignerSurfaceDiagram\r\n\t\t\r\n\t\t#endregion\r\n");

        
        #line default
        #line hidden
        
        #line 279 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

		}

        
        #line default
        #line hidden
        
        #line 281 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\t\t#region IDockableViewModel\r\n");

        
        #line default
        #line hidden
        
        #line 283 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

		if( !(diagramClass is ModalDiagram))
		{

        
        #line default
        #line hidden
        
        #line 286 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("      \t/// <summary>\r\n        /// Unique name of the property grid docking window" +
        ".\r\n        /// </summary>\r\n        public override string DockingPaneName\r\n     " +
        "   {\r\n            get { return \"");

        
        #line default
        #line hidden
        
        #line 292 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Name));

        
        #line default
        #line hidden
        
        #line 292 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("SurfaceDockWindowPane\"; }\r\n        }\r\n\r\n        /// <summary>\r\n        /// Title " +
        "of the docking windo.\r\n        /// </summary>\r\n        public override string Do" +
        "ckingPaneTitle\r\n        {\r\n            get { return \"");

        
        #line default
        #line hidden
        
        #line 300 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Title));

        
        #line default
        #line hidden
        
        #line 300 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write("\"; }\r\n        }\r\n");

        
        #line default
        #line hidden
        
        #line 302 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

		}

        
        #line default
        #line hidden
        
        #line 304 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"
this.Write(@" 
        		
		/// <summary>
		/// Gets the docking pane style. 
		/// </summary>
		public override global::Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.DockingPaneStyle DockingPaneStyle
        {
            get
            {
                return global::Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.DockingPaneStyle.DockedInDocumentPane;
            }
        }
        #endregion		
	}
}

");

        
        #line default
        #line hidden
        
        #line 320 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\TemplatedDiagramGeneratorHelper.tt"

}
private void GenerateCopyClosureInternal(MetaModel dm)
{

        
        #line default
        #line hidden
        
        #line 112 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("/// <summary>\r\n/// Copy closure visitor filter\r\n/// </summary>\r\n");

        
        #line default
        #line hidden
        
        #line 116 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

//GenerateClsCompliantAttribute(AccessModifier.Public);

        
        #line default
        #line hidden
        
        #line 119 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(AccessModifier.Public)));

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

        
        #line default
        #line hidden
        
        #line 119 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 119 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("CopyClosure : ");

        
        #line default
        #line hidden
        
        #line 119 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 119 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("CopyClosureBase, DslModeling::IElementVisitorFilter\r\n{\r\n\t/// <summary>\r\n\t/// Cons" +
        "tructor\r\n\t/// </summary>\r\n\tpublic ");

        
        #line default
        #line hidden
        
        #line 124 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 124 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("CopyClosure() : base()\r\n\t{\r\n\t}\r\n}\r\n/// <summary>\r\n/// Base class for copy closure" +
        " visitor filter\r\n/// </summary>\r\n");

        
        #line default
        #line hidden
        
        #line 131 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

//GenerateClsCompliantAttribute(AccessModifier.Public);

        
        #line default
        #line hidden
        
        #line 134 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(AccessModifier.Public)));

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

        
        #line default
        #line hidden
        
        #line 134 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 134 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("CopyClosureBase : DslModeling::CopyClosureFilter, DslModeling::IElementVisitorFil" +
        "ter\r\n{\r\n\t/// <summary>\r\n\t/// Constructor\r\n\t/// </summary>\r\n\tpublic ");

        
        #line default
        #line hidden
        
        #line 139 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 139 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("CopyClosureBase():base()\r\n\t{\r\n\t}\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 143 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

}
public void GenerateViewModelOptions(MetaModel dm)
{
	if( dm.LanguageType == LanguageType.WPFEditor || dm.LanguageType == LanguageType.VMXEditor)
		{

        
        #line default
        #line hidden
        
        #line 12 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("\r\nnamespace ");

        
        #line default
        #line hidden
        
        #line 14 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

        
        #line default
        #line hidden
        
        #line 14 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(".ViewModel\r\n{\t\r\n\t/// <summary>\r\n\t/// This class is used to store common options.\r" +
        "\n\t/// </summary>\r\n\tpublic partial class ");

        
        #line default
        #line hidden
        
        #line 19 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 19 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions : global::Tum.PDE.ToolFramework.Modeling.Visualization.Base.View" +
        "ModelOptions\r\n\t{\r\n\t\t/// <summary>\r\n\t\t/// Constructor.\r\n\t\t/// </summary>\r\n\t\tpubli" +
        "c ");

        
        #line default
        #line hidden
        
        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions() : base()\r\n\t\t{\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t/// <summary>\r\n        ///" +
        " Loads options.\r\n        /// </summary>\r\n        /// <param name=\"filePath\">File" +
        " name to load options from.</param>\r\n        /// <returns>");

        
        #line default
        #line hidden
        
        #line 34 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 34 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions instance.</returns>\r\n        public static ");

        
        #line default
        #line hidden
        
        #line 35 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 35 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions Deserialize(string filePath)\r\n        {\r\n\t\t\tSystem.IO.TextReader" +
        " r = null;\r\n\t\t\ttry \r\n\t\t\t{\r\n    \t      \tSystem.Xml.Serialization.XmlSerializer s " +
        "= new System.Xml.Serialization.XmlSerializer(typeof(");

        
        #line default
        #line hidden
        
        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions));\r\n    \t       \tr = new System.IO.StreamReader(filePath);\r\n    " +
        "\t       \t");

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions serializableObject = (");

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 42 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions)s.Deserialize(r);\r\n\r\n    \t       \treturn serializableObject;\r\n\t\t" +
        "\t}\r\n\t\t\tcatch\r\n\t\t\t{\r\n\t\t\t\treturn new ");

        
        #line default
        #line hidden
        
        #line 48 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 48 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(@"ViewModelOptions();
			}
			finally
			{
				if( r != null )
					r.Close();
			}
        }
		
		/// <summary>
        /// Save options.
        /// </summary>
        /// <param name=""filePath"">File name to save options to.</param>
        /// <param name=""serializableObject"">");

        
        #line default
        #line hidden
        
        #line 61 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 61 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions instance.</param>\r\n        public static void Serialize(string f" +
        "ilePath, ");

        
        #line default
        #line hidden
        
        #line 62 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 62 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions serializableObject)\r\n        {\r\n\t\t\tSystem.IO.TextWriter w = null" +
        ";\r\n\t\t\ttry \r\n\t\t\t{\r\n            \tSystem.Xml.Serialization.XmlSerializer s = new Sy" +
        "stem.Xml.Serialization.XmlSerializer(typeof(");

        
        #line default
        #line hidden
        
        #line 67 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 67 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"
this.Write("ViewModelOptions));\r\n            \tw = new System.IO.StreamWriter(filePath);\r\n    " +
        "        \ts.Serialize(w, serializableObject);\r\n\t\t\t}\r\n\t\t\tcatch\r\n\t\t\t{\r\n\t\t\t\t// ...\r\n" +
        "\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tif( w != null )\r\n\t\t\t\t\tw.Close();\r\n\t\t\t}\r\n        }\t\t\r" +
        "\n\t\t*/\r\n\t}\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 84 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\ViewModelOptionsGenerator.tt"

		}
}
public string GenerateDeleteClosure(MetaModel dm)
{
	this.GenerationEnvironment = null;
	this.GenerateDeleteClosureInternal(dm);
	return this.GenerationEnvironment.ToString();	
}
// Generate an enum for each DomainEnumeration in the model
private void GenerateDomainEnumerationInternal(MetaModel dm, DomainEnumeration domainEnum) 
{
	if(!string.IsNullOrEmpty(domainEnum.Namespace))
	{

        
        #line default
        #line hidden
        
        #line 16 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("namespace ");

        
        #line default
        #line hidden
        
        #line 17 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Namespace));

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

        
        #line default
        #line hidden
        
        #line 19 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

		PushIndent("\t");
	}

        
        #line default
        #line hidden
        
        #line 22 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("/// <summary>\r\n/// DomainEnumeration: ");

        
        #line default
        #line hidden
        
        #line 24 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

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

        
        #line default
        #line hidden
        
        #line 25 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

	this.Write(Utilities.Instance.GenerateComments(domainEnum.Description));

        
        #line default
        #line hidden
        
        #line 27 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("/// </summary>\r\n[System.ComponentModel.TypeConverter(typeof(");

        
        #line default
        #line hidden
        
        #line 29 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 29 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("EnumConverter))]\r\n");

        
        #line default
        #line hidden
        
        #line 30 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

	if(domainEnum.IsFlags)
	{

        
        #line default
        #line hidden
        
        #line 33 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("[global::System.Flags]\r\n");

        
        #line default
        #line hidden
        
        #line 35 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

	}	

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(domainEnum.AccessModifier)));

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(" enum ");

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

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

        
        #line default
        #line hidden
        
        #line 40 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

	double startVal = 1;
	foreach(EnumerationLiteral literal in domainEnum.Literals)
	{

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

        
        #line default
        #line hidden
        
        #line 46 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(literal.Name));

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

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

		PushIndent("\t");
		this.Write(Utilities.Instance.GenerateComments(literal.Description));
		PopIndent();

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

        
        #line default
        #line hidden
        
        #line 53 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

		PushIndent("\t");
		this.Write(Utilities.Instance.GenerateResourceAttributes(literal));
		PopIndent();
		
		if(literal.Value.Trim() != string.Empty)
		{

        
        #line default
        #line hidden
        
        #line 60 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("\t");

        
        #line default
        #line hidden
        
        #line 61 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(literal.Name));

        
        #line default
        #line hidden
        
        #line 61 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(" = ");

        
        #line default
        #line hidden
        
        #line 61 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(literal.Value));

        
        #line default
        #line hidden
        
        #line 61 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(",\r\n");

        
        #line default
        #line hidden
        
        #line 62 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

		}
		else
		{
			if( domainEnum.IsFlags )
			{

        
        #line default
        #line hidden
        
        #line 68 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("\t");

        
        #line default
        #line hidden
        
        #line 69 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(literal.Name));

        
        #line default
        #line hidden
        
        #line 69 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(" = ");

        
        #line default
        #line hidden
        
        #line 69 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(startVal.ToString()));

        
        #line default
        #line hidden
        
        #line 69 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(",\r\n");

        
        #line default
        #line hidden
        
        #line 70 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

				startVal = startVal * 2;
			}
			else
			{

        
        #line default
        #line hidden
        
        #line 75 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("\t");

        
        #line default
        #line hidden
        
        #line 76 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(literal.Name));

        
        #line default
        #line hidden
        
        #line 76 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(",\r\n");

        
        #line default
        #line hidden
        
        #line 77 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

			}
		}
	}

        
        #line default
        #line hidden
        
        #line 81 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("}\r\n/// <summary>\r\n/// Type converter for ");

        
        #line default
        #line hidden
        
        #line 84 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 84 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(" enumeration.\r\n/// </summary>\r\npublic class ");

        
        #line default
        #line hidden
        
        #line 86 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 86 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("EnumConverter : System.ComponentModel.EnumConverter\r\n{\r\n\tSystem.Collections.Gener" +
        "ic.Dictionary<");

        
        #line default
        #line hidden
        
        #line 88 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 88 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(", string> dictionary;\r\n\t\r\n\t/// <summary>\r\n    /// Constructor.\r\n    /// </summary" +
        ">\r\n    public ");

        
        #line default
        #line hidden
        
        #line 93 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 93 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("EnumConverter() : base(typeof(");

        
        #line default
        #line hidden
        
        #line 93 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 93 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("))\r\n    {\r\n        // create lookup dictionary\r\n        dictionary = new System.C" +
        "ollections.Generic.Dictionary<");

        
        #line default
        #line hidden
        
        #line 96 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 96 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(", string>();\r\n");

        
        #line default
        #line hidden
        
        #line 97 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

		foreach(EnumerationLiteral literal in domainEnum.Literals)
		{
			string resourceKey = domainEnum.GetFullName(false)+"/"+literal.Name;

        
        #line default
        #line hidden
        
        #line 101 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("\t\tdictionary.Add(");

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(literal.Name));

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(", ");

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"");

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

        
        #line default
        #line hidden
        
        #line 102 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(".DisplayName\"));\r\n");

        
        #line default
        #line hidden
        
        #line 103 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

		}

        
        #line default
        #line hidden
        
        #line 105 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("    }\r\n\r\n\t/// <summary>\r\n    /// Converts the specified value object to ");

        
        #line default
        #line hidden
        
        #line 109 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 109 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(@".
    /// </summary>
    /// <param name=""context"">An System.ComponentModel.ITypeDescriptorContext that provides a format context.</param>
    /// <param name=""culture"">An optional System.Globalization.CultureInfo. If not supplied, the current culture is assumed.</param>
    /// <param name=""value"">The System.Object to convert.</param>
    /// <returns>");

        
        #line default
        #line hidden
        
        #line 114 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 114 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(@" object that represents the converted value.</returns>
    public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
    {
		string strValue = value as string;
		if( strValue != null )
		{
			foreach(");

        
        #line default
        #line hidden
        
        #line 120 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 120 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(@" d in dictionary.Keys )
			{
				if( dictionary[d] == strValue )
					return d;
			}

		}
        return base.ConvertFrom(context, culture, value);
    }

	/// <summary>
    /// Converts the given value object to the specified destination type.
    /// </summary>
    /// <param name=""context"">An System.ComponentModel.ITypeDescriptorContext that provides a format context.</param>
    /// <param name=""culture"">An optional System.Globalization.CultureInfo. If not supplied, the current culture is assumed.</param>
    /// <param name=""value""> System.Object to convert.</param>
    /// <param name=""destinationType"">The System.Type to convert the value to.</param>
    /// <returns>An System.Object that represents the converted value.</returns>
    public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType)
    {
		");

        
        #line default
        #line hidden
        
        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("? strValue = value as ");

        
        #line default
        #line hidden
        
        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainEnum.Name));

        
        #line default
        #line hidden
        
        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"
this.Write("?;\r\n\t\tif( strValue != null )\r\n\t\t{\r\n\t\t\treturn dictionary[strValue.Value];\r\n\t\t}\r\n\r\n" +
        "        return base.ConvertTo(context, culture, value, destinationType);\r\n    }\r" +
        "\n}\r\n");

        
        #line default
        #line hidden
        
        #line 149 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

	if(!string.IsNullOrEmpty(domainEnum.Namespace))
	{
		PopIndent();

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

        
        #line default
        #line hidden
        
        #line 155 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

	}

        
        #line default
        #line hidden
        
        #line 158 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainEnumerationGenerator.tt"

}
private void GenerateDeleteClosureInternal(MetaModel dm)
{

        
        #line default
        #line hidden
        
        #line 157 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("/// <summary>\r\n/// Remove closure visitor filter\r\n/// </summary>\r\n");

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

//GenerateClsCompliantAttribute(AccessModifier.Public);

        
        #line default
        #line hidden
        
        #line 164 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(AccessModifier.Public)));

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

        
        #line default
        #line hidden
        
        #line 164 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 164 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DeleteClosure : ");

        
        #line default
        #line hidden
        
        #line 164 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 164 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DeleteClosureBase, DslModeling::IElementVisitorFilter\r\n{\r\n\t/// <summary>\r\n\t/// Co" +
        "nstructor\r\n\t/// </summary>\r\n\tpublic ");

        
        #line default
        #line hidden
        
        #line 169 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 169 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DeleteClosure() : base()\r\n\t{\r\n\t}\r\n}\r\n\r\n/// <summary>\r\n/// Base class for remove c" +
        "losure visitor filter\r\n/// </summary>\r\n");

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

//GenerateClsCompliantAttribute(AccessModifier.Public);

        
        #line default
        #line hidden
        
        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(AccessModifier.Public)));

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

        
        #line default
        #line hidden
        
        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DeleteClosureBase : DslModeling::IElementVisitorFilter\r\n{\r\n\t/// <summary>\r\n\t/// D" +
        "omainRoles\r\n\t/// </summary>\r\n\tprivate global::System.Collections.Specialized.Hyb" +
        "ridDictionary domainRoles;\r\n\t/// <summary>\r\n\t/// Constructor\r\n\t/// </summary>\r\n\t" +
        "public ");

        
        #line default
        #line hidden
        
        #line 189 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 189 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DeleteClosureBase()\r\n\t{\r\n\t\t#region Initialize DomainData Table\r\n");

        
        #line default
        #line hidden
        
        #line 192 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

	foreach(DomainRelationship r in dm.AllRelationships)
	{
		if(r.Source.PropagatesDelete)
		{

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("\t\tDomainRoles.Add(");

        
        #line default
        #line hidden
        
        #line 198 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 198 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 198 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.Name));

        
        #line default
        #line hidden
        
        #line 198 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainRoleId, true);\r\n");

        
        #line default
        #line hidden
        
        #line 199 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

		}
		if(r.Target.PropagatesDelete)
		{

        
        #line default
        #line hidden
        
        #line 203 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("\t\tDomainRoles.Add(");

        
        #line default
        #line hidden
        
        #line 204 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 204 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 204 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.Name));

        
        #line default
        #line hidden
        
        #line 204 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainRoleId, true);\r\n");

        
        #line default
        #line hidden
        
        #line 205 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

		}
	}

        
        #line default
        #line hidden
        
        #line 208 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("\t\t#endregion\r\n\t}\r\n\t/// <summary>\r\n\t/// Called to ask the filter if a particular r" +
        "elationship from a source element should be included in the traversal\r\n\t/// </su" +
        "mmary>\r\n\t/// <param name=\"walker\">ElementWalker that is traversing the model</pa" +
        "ram>\r\n\t/// <param name=\"sourceElement\">Model Element playing the source role</pa" +
        "ram>\r\n\t/// <param name=\"sourceRoleInfo\">DomainRoleInfo of the role that the sour" +
        "ce element is playing in the relationship</param>\r\n\t/// <param name=\"domainRelat" +
        "ionshipInfo\">DomainRelationshipInfo for the ElementLink in question</param>\r\n\t//" +
        "/ <param name=\"targetRelationship\">Relationship in question</param>\r\n\t/// <retur" +
        "ns>Yes if the relationship should be traversed</returns>\r\n\tpublic virtual DslMod" +
        "eling::VisitorFilterResult ShouldVisitRelationship(DslModeling::ElementWalker wa" +
        "lker, DslModeling::ModelElement sourceElement, DslModeling::DomainRoleInfo sourc" +
        "eRoleInfo, DslModeling::DomainRelationshipInfo domainRelationshipInfo, DslModeli" +
        "ng::ElementLink targetRelationship)\r\n\t{\r\n\t\treturn DslModeling::VisitorFilterResu" +
        "lt.Yes;\r\n\t}\r\n\t/// <summary>\r\n\t/// Called to ask the filter if a particular role " +
        "player should be Visited during traversal\r\n\t/// </summary>\r\n\t/// <param name=\"wa" +
        "lker\">ElementWalker that is traversing the model</param>\r\n\t/// <param name=\"sour" +
        "ceElement\">Model Element playing the source role</param>\r\n\t/// <param name=\"elem" +
        "entLink\">Element Link that forms the relationship to the role player in question" +
        "</param>\r\n\t/// <param name=\"targetDomainRole\">DomainRoleInfo of the target role<" +
        "/param>\r\n\t/// <param name=\"targetRolePlayer\">Model Element that plays the target" +
        " role in the relationship</param>\r\n\t/// <returns></returns>\r\n\tpublic virtual Dsl" +
        "Modeling::VisitorFilterResult ShouldVisitRolePlayer(DslModeling::ElementWalker w" +
        "alker, DslModeling::ModelElement sourceElement, DslModeling::ElementLink element" +
        "Link, DslModeling::DomainRoleInfo targetDomainRole, DslModeling::ModelElement ta" +
        "rgetRolePlayer)\r\n\t{\r\n\t\tif (targetDomainRole == null) throw new global::System.Ar" +
        "gumentNullException(\"targetDomainRole\");\r\n\t\treturn this.DomainRoles.Contains(tar" +
        "getDomainRole.Id) ? DslModeling::VisitorFilterResult.Yes : DslModeling::VisitorF" +
        "ilterResult.DoNotCare;\r\n\t}\r\n\t/// <summary>\r\n\t/// DomainRoles\r\n\t/// </summary>\r\n\t" +
        "private global::System.Collections.Specialized.HybridDictionary DomainRoles\r\n\t{\r" +
        "\n\t\tget\r\n\t\t{\r\n\t\t\tif (this.domainRoles == null)\r\n\t\t\t{\r\n\t\t\t\tthis.domainRoles = new " +
        "global::System.Collections.Specialized.HybridDictionary();\r\n\t\t\t}\r\n\t\t\treturn this" +
        ".domainRoles;\r\n\t\t}\r\n\t}\r\n\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 254 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

}
private void GenerateRibbonInternal(MetaModel dm)
{

        
        #line default
        #line hidden
        
        #line 16 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\RibbonGeneratorHelper.tt"
this.Write("\r\nprotected Fluent.BackstageTabItem tabItemRecent;\r\nprotected Fluent.BackstageTab" +
        "Item tabItemFI;\r\nprotected Fluent.BackstageTabItem tabItemCredits;\r\n\r\nprotected " +
        "Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemL" +
        "ateInit tabHome;\r\nprotected Fluent.RibbonGroupBox tabHomeGrpCommon;\r\nprotected F" +
        "luent.RibbonGroupBox tabHomeGrpCommands;\r\nprotected Fluent.RibbonGroupBox tabHom" +
        "eGrpNavigation;\r\nprotected Fluent.RibbonGroupBox tabHomeGrpView;\r\nprotected Flue" +
        "nt.RibbonGroupBox tabHomeGrpValidation;\r\n\r\nprotected Tum.PDE.ToolFramework.Model" +
        "ing.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit tabEdit;\r\nprotected" +
        " Fluent.RibbonGroupBox tabEditGrpFindAdv;\r\nprotected Fluent.RibbonGroupBox tabEd" +
        "itGrpFind;\r\n\r\nprotected Tum.PDE.ToolFramework.Modeling.Visualization.Base.Contro" +
        "ls.Ribbon.RibbonTabItemLateInit tabView;\r\nprotected Fluent.RibbonGroupBox tabVie" +
        "wgrpMC;\r\nprotected Fluent.RibbonGroupBox tabViewGrpAV;\r\n\r\nprotected Tum.PDE.Tool" +
        "Framework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit tabP" +
        "lugins;\r\nprotected Fluent.RibbonGroupBox tabPluginsGrpInformation;\r\nprotected Fl" +
        "uent.RibbonGroupBox tabPluginsGrpFP;\r\nprotected Fluent.RibbonGroupBox tabPlugins" +
        "GrpVP;\r\n\r\nprotected Fluent.Button backstageSaveModelButton;\r\nprotected Fluent.Bu" +
        "tton backstageSaveAsModelButton;\r\nprotected Fluent.Button backstageCloseModelBut" +
        "ton;\r\n\r\nprotected override void CreateRibbon()\r\n{\r\n\tbase.CreateRibbon();\r\n\r\n    " +
        "CreateRibbonBackstage(Ribbon);\r\n\r\n\tFluent.RibbonTabItem t = CreateRibbonHomeTab(" +
        "Ribbon);\r\n\tif( t != null )\r\n    \tRibbon.Tabs.Add(t);\r\n\t\r\n\tFluent.RibbonTabItem t" +
        "2 = CreateRibbonEditTab(Ribbon);\r\n\tif( t2 != null )\r\n    \tRibbon.Tabs.Add(t2);\r\n" +
        "\t\r\n\tFluent.RibbonTabItem t3 = CreateRibbonViewTab(Ribbon);\r\n\tif( t3 != null )\r\n " +
        "   \tRibbon.Tabs.Add(t3);\r\n\t\r\n\tFluent.RibbonTabItem t4 = CreateRibbonPluginsTab(R" +
        "ibbon);\r\n\tif( t4 != null )\r\n    \tRibbon.Tabs.Add(t4);\r\n\t\r\n\tif( this.tabEdit != n" +
        "ull )\r\n\t\tthis.tabEdit.IsEnabled = false;\r\n\t\r\n\tif( this.tabPlugins != null )\r\n\t\tt" +
        "his.tabPlugins.IsEnabled = false;\r\n}\r\n\r\nprotected override void SetupRibbonOnMai" +
        "nSolutionLoad()\r\n{\r\n\tif( this.tabEdit != null )\r\n\t\tthis.tabEdit.IsEnabled = true" +
        ";\r\n\t\r\n\tif( this.tabPlugins != null )\r\n\t\tthis.tabPlugins.IsEnabled = true;\r\n\t\r\n\ti" +
        "f( this.tabHomeGrpCommon != null )\r\n\t\tthis.tabHomeGrpCommon.IsEnabled = true;\r\n\t" +
        "\r\n\tif( this.tabHomeGrpCommands != null )\r\n\t\tthis.tabHomeGrpCommands.IsEnabled = " +
        "true;\r\n\t\r\n\tif( this.tabHomeGrpNavigation != null )\t\r\n\t\tthis.tabHomeGrpNavigation" +
        ".IsEnabled = true;\r\n\t\r\n\tif( this.tabHomeGrpView != null )\r\n\t\tthis.tabHomeGrpView" +
        ".IsEnabled = true;\r\n\t\r\n\tif( this.tabHomeGrpValidation != null )\r\n\t\tthis.tabHomeG" +
        "rpValidation.IsEnabled = true;\t\r\n\t\r\n\tif( this.tabView != null )\r\n\t\tif( this.tabV" +
        "iewGrpAV == null )\r\n\t\t\tthis.CreateRibbonViewTabAVGroup();\r\n\t\r\n\tif( this.tabPlugi" +
        "ns != null )\r\n\t\tif (this.tabPluginsGrpFP == null)\r\n\t\t\tCreateRibbonFPGroup();\r\n\t\t" +
        "\r\n\tif( this.tabPlugins != null )\r\n\t\tif (this.tabPluginsGrpVP == null)\r\n\t\t\tCreate" +
        "RibbonVPGroup();\r\n\t\r\n\tbackstageSaveModelButton.IsEnabled = true;\r\n\tbackstageSave" +
        "AsModelButton.IsEnabled = true;\r\n\tbackstageCloseModelButton.IsEnabled = true;\r\n}" +
        "\t\r\n\r\nprotected virtual Fluent.RibbonTabItem CreateRibbonHomeTab(Fluent.Ribbon ri" +
        "bbon)\r\n{\r\n    tabHome = new Tum.PDE.ToolFramework.Modeling.Visualization.Base.Co" +
        "ntrols.Ribbon.RibbonTabItemLateInit();\r\n    tabHome.Header = \"Home\";\r\n    tabHom" +
        "e.LateInitializationTriggered += new EventHandler(TabHome_LateInitializationTrig" +
        "gered);\r\n\r\n    return tabHome;\r\n}\r\nprotected virtual void TabHome_LateInitializa" +
        "tionTriggered(object sender, EventArgs e)\r\n{\r\n    Tum.PDE.ToolFramework.Modeling" +
        ".Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit tabHome = (Tum.PDE.Too" +
        "lFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit)sen" +
        "der;\r\n    tabHome.LateInitializationTriggered -= new EventHandler(TabHome_LateIn" +
        "itializationTriggered);\r\n\r\n    Fluent.RibbonGroupBox grpCommon = new Fluent.Ribb" +
        "onGroupBox();\r\n    grpCommon.Header = \"Common\";\r\n    grpCommon.Items.Add(Tum.PDE" +
        ".ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper." +
        "CreateButton(\r\n        \"Delete\", \"pack://application:,,,/Tum.PDE.ToolFramework.I" +
        "mages;component/Ribbon/Delete-32.png\", \"Large\", \"ActiveViewModel.DeleteCommand\")" +
        ");\r\n    grpCommon.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Co" +
        "ntrols.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Cut\", \"pack://applica" +
        "tion:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Cut-16.png\", \"Middle\", \"A" +
        "ctiveViewModel.CutCommand\"));\r\n    grpCommon.Items.Add(Tum.PDE.ToolFramework.Mod" +
        "eling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(\r\n   " +
        "     \"Copy\", \"pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribb" +
        "on/Copy-16.png\", \"Middle\", \"ActiveViewModel.CopyCommand\"));\r\n    grpCommon.Items" +
        ".Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCre" +
        "ationHelper.CreateButton(\r\n        \"Paste\", \"pack://application:,,,/Tum.PDE.Tool" +
        "Framework.Images;component/Ribbon/Paste-16.png\", \"Middle\", \"ActiveViewModel.Past" +
        "eCommand\"));\r\n    tabHome.Groups.Add(grpCommon);\r\n    tabHomeGrpCommon = grpComm" +
        "on;\r\n\r\n    Fluent.RibbonGroupBox grpCommands = new Fluent.RibbonGroupBox();\r\n   " +
        " grpCommands.Header = \"Commands\";\r\n    grpCommands.Items.Add(Tum.PDE.ToolFramewo" +
        "rk.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton" +
        "(\r\n        \"Undo\", \"pack://application:,,,/Tum.PDE.ToolFramework.Images;componen" +
        "t/Ribbon/Undo-32.png\", \"Large\", \"ActiveViewModel.UndoCommand\"));\r\n    grpCommand" +
        "s.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.Ri" +
        "bbonCreationHelper.CreateButton(\r\n        \"Redo\", \"pack://application:,,,/Tum.PD" +
        "E.ToolFramework.Images;component/Ribbon/Redo-32.png\", \"Large\", \"ActiveViewModel." +
        "RedoCommand\"));\r\n    tabHome.Groups.Add(grpCommands);\r\n    tabHomeGrpCommands = " +
        "grpCommands;\r\n\r\n    Fluent.RibbonGroupBox grpNavigation = new Fluent.RibbonGroup" +
        "Box();\r\n    grpNavigation.Header = \"Navigation\";\r\n    grpNavigation.Items.Add(Tu" +
        "m.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHe" +
        "lper.CreateButton(\r\n        \"Back\", \"pack://application:,,,/Tum.PDE.ToolFramewor" +
        "k.Images;component/Ribbon/Back-32.png\", \"Large\", \"NavigateBackwardCommand\"));\r\n " +
        "   grpNavigation.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Con" +
        "trols.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Forward\", \"pack://appl" +
        "ication:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Forward-32.png\", \"Larg" +
        "e\", \"NavigateForwardCommand\"));\r\n    tabHome.Groups.Add(grpNavigation);\r\n    tab" +
        "HomeGrpNavigation = grpNavigation;\r\n\r\n    // check which buttons are required\r\n " +
        "   Fluent.RibbonGroupBox grpView = new Fluent.RibbonGroupBox();\r\n    grpView.Hea" +
        "der = \"View\";\r\n    grpView.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualizatio" +
        "n.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Model Tree\"," +
        " \"pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/ModelTree" +
        "-32.png\", \"Large\", \"ShowModelTreeCommand\"));\r\n    grpView.Items.Add(Tum.PDE.Tool" +
        "Framework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.Creat" +
        "eButton(\r\n        \"Property Window\", \"pack://application:,,,/Tum.PDE.ToolFramewo" +
        "rk.Images;component/Ribbon/PropertyGrid-32.png\", \"Large\", \"ShowPropertiesCommand" +
        "\"));\r\n    grpView.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Co" +
        "ntrols.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Error List\", \"pack://" +
        "application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/ErrorList-32.png\"," +
        " \"Large\", \"ShowErrorListCommand\"));\r\n    grpView.Items.Add(Tum.PDE.ToolFramework" +
        ".Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(\r" +
        "\n        \"Dependencies   \", \"pack://application:,,,/Tum.PDE.ToolFramework.Images" +
        ";component/Ribbon/Refresh-16.png\", \"Middle\", \"ShowDependenciesCommand\"));\r\n    g" +
        "rpView.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribb" +
        "on.RibbonCreationHelper.CreateButton(\r\n        \"Diagram Surface\", \"pack://applic" +
        "ation:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/DiagramSurface-16.png\", " +
        "\"Middle\", \"ShowDiagramSurfaceCommand\"));\r\n    tabHome.Groups.Add(grpView);\r\n    " +
        "tabHomeGrpView = grpView;\r\n\r\n    // check if required\r\n    Fluent.RibbonGroupBox" +
        " grpValidation = new Fluent.RibbonGroupBox();\r\n    grpValidation.Header = \"Comma" +
        "nds\";\r\n    grpValidation.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualization." +
        "Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Validate\", \"pa" +
        "ck://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Validate-32.p" +
        "ng\", \"Large\", \"ActiveViewModel.ValidateCommand\"));\r\n    grpValidation.Items.Add(" +
        "Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreation" +
        "Helper.CreateButton(\r\n        \"Validate All\", \"pack://application:,,,/Tum.PDE.To" +
        "olFramework.Images;component/Ribbon/ValidateAll-32.png\", \"Large\", \"ValidateAllCo" +
        "mmand\"));\r\n    tabHomeGrpValidation = grpValidation;\r\n    tabHome.Groups.Add(grp" +
        "Validation);\r\n\t\r\n\tthis.tabHomeGrpCommon.IsEnabled = false;\r\n\tthis.tabHomeGrpComm" +
        "ands.IsEnabled = false;\r\n\tthis.tabHomeGrpNavigation.IsEnabled = false;\r\n\tthis.ta" +
        "bHomeGrpView.IsEnabled = false;\r\n\tthis.tabHomeGrpValidation.IsEnabled = false;\r\n" +
        "}\r\n\r\nprotected virtual Fluent.RibbonTabItem CreateRibbonEditTab(Fluent.Ribbon ri" +
        "bbon)\r\n{\r\n    tabEdit = new Tum.PDE.ToolFramework.Modeling.Visualization.Base.Co" +
        "ntrols.Ribbon.RibbonTabItemLateInit();\r\n    tabEdit.Header = \"Edit\";\r\n    tabEdi" +
        "t.LateInitializationTriggered += new EventHandler(TabEdit_LateInitializationTrig" +
        "gered);\r\n    return tabEdit;\r\n}\r\nprotected virtual void TabEdit_LateInitializati" +
        "onTriggered(object sender, EventArgs e)\r\n{\r\n    Tum.PDE.ToolFramework.Modeling.V" +
        "isualization.Base.Controls.Ribbon.RibbonTabItemLateInit tabEdit = (Tum.PDE.ToolF" +
        "ramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit)sende" +
        "r;\r\n    tabEdit.LateInitializationTriggered -= new EventHandler(TabEdit_LateInit" +
        "ializationTriggered);\r\n\t\r\n    Fluent.RibbonGroupBox grpFindAdv = new Fluent.Ribb" +
        "onGroupBox();\r\n    grpFindAdv.Header = \"Find Advanced\";\r\n    grpFindAdv.Items.Ad" +
        "d(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreati" +
        "onHelper.CreateButton(\r\n        \"Find Advanced\", \"pack://application:,,,/Tum.PDE" +
        ".ToolFramework.Images;component/Ribbon/SearchAdvanced-32.png\", \"Large\", \"SearchM" +
        "odel.SearchAdvancedCommand\"));\r\n    tabEdit.Groups.Add(grpFindAdv);\r\n    tabEdit" +
        "GrpFindAdv = grpFindAdv;\r\n\r\n    Fluent.RibbonGroupBox grpFind = new Fluent.Ribbo" +
        "nGroupBox();\r\n    grpFind.Header = \"Quick Find\";\r\n    System.Windows.Controls.Te" +
        "xtBox txt = new System.Windows.Controls.TextBox();\r\n    txt.Width = 250;\r\n    tx" +
        "t.Margin = new Thickness(0, 0, 0, 1);\r\n    tabEditGrpFind = grpFind;\r\n\r\n    Bind" +
        "ing txtBinding = new Binding(\"SearchModel.SearchText\");\r\n    txtBinding.UpdateSo" +
        "urceTrigger = UpdateSourceTrigger.PropertyChanged;\r\n    txtBinding.Mode = Bindin" +
        "gMode.TwoWay;\r\n    txt.SetBinding(System.Windows.Controls.TextBox.TextProperty, " +
        "txtBinding);\r\n    grpFind.Items.Add(txt);\r\n\r\n    Fluent.ComboBox cmb = new Fluen" +
        "t.ComboBox();\r\n    cmb.IsReadOnly = true;\r\n    cmb.DisplayMemberPath = \"DisplayN" +
        "ame\";\r\n    cmb.Text = \"Find where\";\r\n    cmb.Height = 23;\r\n    cmb.Width = 250;\r" +
        "\n    grpFind.Items.Add(cmb);\r\n    Binding itemsSourceB = new Binding(\"SearchMode" +
        "l.SearchSource\");\r\n    itemsSourceB.Mode = BindingMode.OneWay;\r\n    cmb.SetBindi" +
        "ng(Fluent.ComboBox.ItemsSourceProperty, itemsSourceB);\r\n    Binding selectedItem" +
        "B = new Binding(\"SearchModel.SelectedSearchSource\");\r\n    selectedItemB.Mode = B" +
        "indingMode.TwoWay;\r\n    cmb.SetBinding(Fluent.ComboBox.SelectedItemProperty, sel" +
        "ectedItemB);\r\n\r\n    Fluent.ComboBox cmb2 = new Fluent.ComboBox();\r\n    cmb2.IsRe" +
        "adOnly = true;\r\n    cmb2.DisplayMemberPath = \"DisplayName\";\r\n    cmb2.Text = \"Fi" +
        "nd criteria\";\r\n    cmb2.Height = 23;\r\n    cmb2.Width = 250;\r\n    Binding itemsSo" +
        "urceB2 = new Binding(\"SearchModel.SearchCriteria\");\r\n    itemsSourceB2.Mode = Bi" +
        "ndingMode.OneWay;\r\n    cmb2.SetBinding(Fluent.ComboBox.ItemsSourceProperty, item" +
        "sSourceB2);\r\n    Binding selectedItemB2 = new Binding(\"SearchModel.SelectedSearc" +
        "hCriteria\");\r\n    selectedItemB2.Mode = BindingMode.TwoWay;\r\n    cmb2.SetBinding" +
        "(Fluent.ComboBox.SelectedItemProperty, selectedItemB2);\r\n    grpFind.Items.Add(c" +
        "mb2);\r\n\r\n    grpFind.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base" +
        ".Controls.Ribbon.RibbonCreationHelper.CreateButton(\r\n         \"Find\", \"pack://ap" +
        "plication:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Search-32.png\", \"Lar" +
        "ge\", \"SearchModel.SearchCommand\"));\r\n\r\n    tabEdit.Groups.Add(grpFind);\r\n}\r\n\r\npr" +
        "otected virtual Fluent.RibbonTabItem CreateRibbonViewTab(Fluent.Ribbon ribbon)\r\n" +
        "{\r\n    tabView = new Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls." +
        "Ribbon.RibbonTabItemLateInit();\r\n    tabView.Header = \"View\";\r\n    \r\n\t// see if " +
        "required\r\n    Fluent.RibbonGroupBox grpMC = new Fluent.RibbonGroupBox();\r\n    gr" +
        "pMC.Header = \"Model Contexts\";\r\n\r\n    ContentControl c = new ContentControl();\r\n" +
        "    c.Template = (ControlTemplate)FindResource(\"RibbonViewTabMCTemplate\");\r\n    " +
        "grpMC.Items.Add(c);\r\n    tabView.Groups.Add(grpMC);\r\n    tabViewgrpMC = grpMC;\r\n" +
        "\t\r\n    return tabView;\r\n}\r\nprotected virtual Fluent.RibbonGroupBox CreateRibbonV" +
        "iewTabAVGroup()\r\n{\r\n    // see if required\r\n    Fluent.RibbonGroupBox grpAV = ne" +
        "w Fluent.RibbonGroupBox();\r\n    grpAV.Header = \"Additional Views\";\r\n\r\n    Conten" +
        "tControl c2 = new ContentControl();\r\n    c2.Template = (ControlTemplate)FindReso" +
        "urce(\"RibbonViewTabAVTemplate\");\r\n    grpAV.Items.Add(c2);\r\n    tabView.Groups.A" +
        "dd(grpAV);\r\n    tabViewGrpAV = grpAV;\r\n    return grpAV;\r\n}\r\n\r\nprotected virtual" +
        " Fluent.RibbonTabItem CreateRibbonPluginsTab(Fluent.Ribbon ribbon)\r\n{\r\n    tabPl" +
        "ugins = new Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.Ri" +
        "bbonTabItemLateInit();\r\n    tabPlugins.Header = \"Plugins\";\r\n    tabPlugins.LateI" +
        "nitializationTriggered += new EventHandler(TabPlugins_LateInitializationTriggere" +
        "d);\r\n\r\n    return tabPlugins;\r\n}\r\nprotected virtual Fluent.RibbonGroupBox Create" +
        "RibbonFPGroup()\r\n{\r\n    Fluent.RibbonGroupBox grpFP = new Fluent.RibbonGroupBox(" +
        ");\r\n    grpFP.Header = \"Functionality Plugins\";\r\n    ContentControl c = new Cont" +
        "entControl();\r\n    c.Template = (ControlTemplate)FindResource(\"RibbonPluginsTabF" +
        "PTemplate\");\r\n    grpFP.Items.Add(c);\r\n    tabPlugins.Groups.Add(grpFP);\r\n    ta" +
        "bPluginsGrpFP = grpFP;\r\n\t\r\n\treturn grpFP;\r\n}\r\nprotected virtual Fluent.RibbonGro" +
        "upBox CreateRibbonVPGroup()\r\n{\r\n   Fluent.RibbonGroupBox grpVP = new Fluent.Ribb" +
        "onGroupBox();\r\n    grpVP.Header = \"View Plugins\";\r\n    ContentControl c2 = new C" +
        "ontentControl();\r\n    c2.Template = (ControlTemplate)FindResource(\"RibbonPlugins" +
        "TabVPTemplate\");\r\n    grpVP.Items.Add(c2);\r\n    tabPlugins.Groups.Add(grpVP);\r\n " +
        "   tabPluginsGrpVP = grpVP;\r\n\treturn grpVP;\r\n}\r\nprotected virtual void TabPlugin" +
        "s_LateInitializationTriggered(object sender, EventArgs e)\r\n{\r\n    Tum.PDE.ToolFr" +
        "amework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit tabPlu" +
        "gins = (Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.Ribbon" +
        "TabItemLateInit)sender;\r\n    tabPlugins.LateInitializationTriggered -= new Event" +
        "Handler(TabPlugins_LateInitializationTriggered);\r\n\r\n    Fluent.RibbonGroupBox gr" +
        "pInformation = new Fluent.RibbonGroupBox();\r\n    grpInformation.Header = \"Inform" +
        "ation\";\r\n    grpInformation.Items.Add(Tum.PDE.ToolFramework.Modeling.Visualizati" +
        "on.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Info\", \"pac" +
        "k://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Information-32" +
        "x32.png\", \"Large\", \"PluginInformationCommand\"));\r\n    tabPlugins.Groups.Add(grpI" +
        "nformation);\r\n    tabPluginsGrpInformation = grpInformation;\r\n}\r\n\r\nprotected vir" +
        "tual void CreateRibbonBackstage(Fluent.Ribbon ribbon)\r\n{\r\n    ribbon.BackstageIt" +
        "ems.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.Ribbon" +
        "CreationHelper.CreateButton(\r\n        \"New\", \"pack://application:,,,/Tum.PDE.Too" +
        "lFramework.Images;component/Ribbon/New-16.png\", \"Medium\", \"NewModelCommand\"));\r\n" +
        "    ribbon.BackstageItems.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base." +
        "Controls.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Open...\", \"pack://a" +
        "pplication:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Open-16.png\", \"Medi" +
        "um\", \"OpenModelCommand\"));\r\n    \r\n\tbackstageSaveModelButton = Tum.PDE.ToolFramew" +
        "ork.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButto" +
        "n(\r\n        \"Save\", \"pack://application:,,,/Tum.PDE.ToolFramework.Images;compone" +
        "nt/Ribbon/Save-16.png\", \"Medium\", \"SaveModelCommand\");\r\n\tribbon.BackstageItems.A" +
        "dd(backstageSaveModelButton);\r\n\tbackstageSaveModelButton.IsEnabled = false;\r\n\t\t\r" +
        "\n\tbackstageSaveAsModelButton = Tum.PDE.ToolFramework.Modeling.Visualization.Base" +
        ".Controls.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Save As...\", \"pack" +
        "://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/SaveAs-32.png\"," +
        " \"Medium\", \"SaveAsModelCommand\");\r\n    ribbon.BackstageItems.Add(backstageSaveAs" +
        "ModelButton);\r\n\tbackstageSaveAsModelButton.IsEnabled = false;\r\n\r\n    Fluent.Back" +
        "stageTabItem tabItemRecent = new Fluent.BackstageTabItem();\r\n    tabItemRecent.H" +
        "eader = \"Recent\";\r\n    ContentControl c = new ContentControl();\r\n    c.Template " +
        "= (ControlTemplate)FindResource(\"RibbonBackstageRecentItemsTemplate\");\r\n    tabI" +
        "temRecent.Content = c;\r\n    ribbon.BackstageItems.Add(tabItemRecent);\r\n\r\n    // " +
        "see if needed\r\n    tabItemFI = new Fluent.BackstageTabItem();\r\n    tabItemFI.Hea" +
        "der = \"Further Information\";\r\n    ContentControl c2 = new ContentControl();\r\n   " +
        " c2.Template = (ControlTemplate)FindResource(\"RibbonBackstageFurtherInformationT" +
        "emplate\");\r\n    tabItemFI.Content = c2;\r\n    ribbon.BackstageItems.Add(tabItemFI" +
        ");\r\n\r\n    // see if needed\r\n    tabItemCredits = new Fluent.BackstageTabItem();\r" +
        "\n    tabItemCredits.Header = \"Credits\";\r\n    ContentControl c3 = new ContentCont" +
        "rol();\r\n    c3.Template = (ControlTemplate)FindResource(\"RibbonBackstageCreditsT" +
        "emplate\");\r\n    tabItemCredits.Content = c3;\r\n    ribbon.BackstageItems.Add(tabI" +
        "temCredits);\r\n\r\n\tbackstageCloseModelButton = Tum.PDE.ToolFramework.Modeling.Visu" +
        "alization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(\r\n        \"Clos" +
        "e\", \"pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/CloseD" +
        "ocument-32.png\", \"Medium\", \"CloseModelCommand\");\r\n    ribbon.BackstageItems.Add(" +
        "backstageCloseModelButton);\r\n\tbackstageCloseModelButton.IsEnabled = false;\r\n\r\n  " +
        "  Fluent.Button b = new Fluent.Button();\r\n    b.Text = \"Exit\";\r\n    b.Click += n" +
        "ew RoutedEventHandler(ExitButton_Click);\r\n    b.Icon = new System.Windows.Media." +
        "Imaging.BitmapImage(new Uri(\"pack://application:,,,/Tum.PDE.ToolFramework.Images" +
        ";component/Ribbon/Exit-16.png\", UriKind.Absolute));\r\n\r\n    ribbon.BackstageItems" +
        ".Add(b);\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 385 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\WPFApplication\RibbonGeneratorHelper.tt"

}
public string GenerateClosureProperties(MetaModel dm)
{
	this.GenerationEnvironment = null;
	this.GenerateClosurePropertiesInternal(dm);
	return this.GenerationEnvironment.ToString();	
}
 public static string GetMainPropertyGridViewModelFullName(MetaModel dm)
 {
     string fullName = dm.Namespace + ".ViewModel.";
     fullName += dm.Name + "PropertyGridViewModel";
     return fullName;
 }
private void GenerateClosurePropertiesInternal(MetaModel dm)
{

        
        #line default
        #line hidden
        
        #line 13 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(@"/// <summary>
/// CopyClosure cache
/// </summary>
private static DslModeling::IElementVisitorFilter copyClosure;
/// <summary>
/// DeleteClosure cache
/// </summary>
private static DslModeling::IElementVisitorFilter removeClosure;
/// <summary>
/// Returns an IElementVisitorFilter that corresponds to the ClosureType.
/// </summary>
/// <param name=""type"">closure type</param>
/// <param name=""rootElements"">collection of root elements</param>
/// <returns>IElementVisitorFilter or null</returns>
public override DslModeling::IElementVisitorFilter GetClosureFilter(DslModeling::ClosureType type, global::System.Collections.Generic.ICollection<DslModeling::ModelElement> rootElements)
{
	switch (type)
	{
		case DslModeling::ClosureType.CopyClosure:
			return ");

        
        #line default
        #line hidden
        
        #line 33 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 33 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainModel.CopyClosure;\r\n\t\tcase DslModeling::ClosureType.DeleteClosure:\r\n\t\t\tretu" +
        "rn ");

        
        #line default
        #line hidden
        
        #line 35 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 35 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(@"DomainModel.DeleteClosure;
	}
	return base.GetClosureFilter(type, rootElements);
}
/// <summary>
/// CopyClosure cache
/// </summary>
private static DslModeling::IElementVisitorFilter CopyClosure
{
	get
	{
		// Incorporate all of the closures from the models we extend
		if (");

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainModel.copyClosure == null)\r\n\t\t{\r\n\t\t\tDslModeling::ChainingElementVisitorFilt" +
        "er copyFilter = new DslModeling::ChainingElementVisitorFilter();\r\n\t\t\tcopyFilter." +
        "AddFilter(new ");

        
        #line default
        #line hidden
        
        #line 50 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 50 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("CopyClosure());\r\n");

        
        #line default
        #line hidden
        
        #line 51 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

	// We don't need to add the Core model because it has no copy/delete propagation.
	// Add the CDS Model if we have diagram elements in this Dsl
	/*if(dm.DiagramElements!=null && dm.DiagramElements.Count>0)
	{

        
        #line default
        #line hidden
        
        #line 56 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("\t\t\tcopyFilter.AddFilter(new DslDiagrams::CoreDesignSurfaceCopyClosure());\r\n");

        
        #line default
        #line hidden
        
        #line 58 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

	}*/

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

        
        #line default
        #line hidden
        
        #line 62 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 62 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainModel.copyClosure = copyFilter;\r\n\t\t}\r\n\t\treturn ");

        
        #line default
        #line hidden
        
        #line 64 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 64 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainModel.copyClosure;\r\n\t}\r\n}\r\n/// <summary>\r\n/// DeleteClosure cache\r\n/// </su" +
        "mmary>\r\nprivate static DslModeling::IElementVisitorFilter DeleteClosure\r\n{\r\n\tget" +
        "\r\n\t{\r\n\t\t// Incorporate all of the closures from the models we extend\r\n");

        
        #line default
        #line hidden
        
        #line 75 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

		// UNDONE: GeMathew - Add closure filters of all models we extend.

        
        #line default
        #line hidden
        
        #line 77 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("\t\tif (");

        
        #line default
        #line hidden
        
        #line 78 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 78 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainModel.removeClosure == null)\r\n\t\t{\r\n\t\t\tDslModeling::ChainingElementVisitorFi" +
        "lter removeFilter = new DslModeling::ChainingElementVisitorFilter();\r\n\t\t\tremoveF" +
        "ilter.AddFilter(new ");

        
        #line default
        #line hidden
        
        #line 81 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 81 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DeleteClosure());\r\n");

        
        #line default
        #line hidden
        
        #line 82 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

	// We don't need to add the Core model because it has no copy/delete propagation.
	// Add the CDS Model if we have diagram elements in this Dsl
	/*if(dm.DiagramElements!=null && dm.DiagramElements.Count>0)
	{

        
        #line default
        #line hidden
        
        #line 87 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("\t\t\tremoveFilter.AddFilter(new DslDiagrams::CoreDesignSurfaceDeleteClosure());\r\n");

        
        #line default
        #line hidden
        
        #line 89 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

	}*/

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

        
        #line default
        #line hidden
        
        #line 93 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 93 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainModel.removeClosure = removeFilter;\r\n\t\t}\r\n\t\treturn ");

        
        #line default
        #line hidden
        
        #line 95 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 95 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"
this.Write("DomainModel.removeClosure;\r\n\t}\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 98 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ClosuresGenerator.tt"

}
public string GenerateCodeExampleForDiagram(MetaModel dm)
{
	this.GenerationEnvironment = null;
	this.GenerateCodeExampleForDiagramInternal(dm);
	return this.GenerationEnvironment.ToString();
}
        private void WriteChildElementsExtended(DslModeling::SerializationContext serializationContext, MetaModel element, global::System.Xml.XmlWriter writer)
        {
           // MetaModelHasDomainTypes
			global::System.Collections.ObjectModel.ReadOnlyCollection<MetaModelHasDomainTypes> allMetaModelHasDomainTypesInstances = MetaModelHasDomainTypes.GetLinksToDomainTypes(element);
			if (!serializationContext.Result.Failed && allMetaModelHasDomainTypesInstances.Count > 0)
			{
				writer.WriteStartElement("domainTypes");
				global::System.Type typeofMetaModelHasDomainTypes = typeof(MetaModelHasDomainTypes);
				foreach (MetaModelHasDomainTypes eachMetaModelHasDomainTypesInstance in allMetaModelHasDomainTypesInstances)
				{
					if (serializationContext.Result.Failed)
						break;
	
					if (eachMetaModelHasDomainTypesInstance.GetType() != typeofMetaModelHasDomainTypes)
					{	// Derived relationships will be serialized in full-form.
						DslModeling::DomainClassXmlSerializer derivedRelSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasDomainTypesInstance.GetDomainClass().Id);
						global::System.Diagnostics.Debug.Assert(derivedRelSerializer != null, "Cannot find serializer for " + eachMetaModelHasDomainTypesInstance.GetDomainClass().Name + "!");			
						derivedRelSerializer.Write(serializationContext, eachMetaModelHasDomainTypesInstance, writer);
					}
					else
					{	// No need to serialize the relationship itself, just serialize the role-player directly.
						DslModeling::ModelElement targetElement = eachMetaModelHasDomainTypesInstance.DomainType;
						DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
						global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");			
						targetSerializer.Write(serializationContext, targetElement, writer);
					}
				}
				writer.WriteEndElement();
			}
	
			// MetaModelHasValidation
			MetaModelHasValidation theMetaModelHasValidationInstance = MetaModelHasValidation.GetLinkToValidation(element);
			if (!serializationContext.Result.Failed && theMetaModelHasValidationInstance != null)
			{
				writer.WriteStartElement("validation");
				DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasValidationInstance.GetDomainClass().Id);
				global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasValidationInstance.GetDomainClass().Name + "!");
				relSerializer.Write(serializationContext, theMetaModelHasValidationInstance, writer);
				writer.WriteEndElement();
			}
	
			// MetaModelHasAdditionalInformation
			MetaModelHasAdditionalInformation theMetaModelHasAdditionalInformationInstance = MetaModelHasAdditionalInformation.GetLinkToAdditionalInformation(element);
			if (!serializationContext.Result.Failed && theMetaModelHasAdditionalInformationInstance != null)
			{
				writer.WriteStartElement("additionalInformation");
				DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasAdditionalInformationInstance.GetDomainClass().Id);
				global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasAdditionalInformationInstance.GetDomainClass().Name + "!");
				relSerializer.Write(serializationContext, theMetaModelHasAdditionalInformationInstance, writer);
				writer.WriteEndElement();
			}
	
			// MetaModelHasMetaModelLibraries
			global::System.Collections.ObjectModel.ReadOnlyCollection<MetaModelHasMetaModelLibraries> allMetaModelHasMetaModelLibrariesInstances = MetaModelHasMetaModelLibraries.GetLinksToMetaModelLibraries(element);
			if (!serializationContext.Result.Failed && allMetaModelHasMetaModelLibrariesInstances.Count > 0)
			{
				writer.WriteStartElement("metaModelLibraries");
				foreach (MetaModelHasMetaModelLibraries eachMetaModelHasMetaModelLibrariesInstance in allMetaModelHasMetaModelLibrariesInstances)
				{
					if (serializationContext.Result.Failed)
						break;
	
					DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasMetaModelLibrariesInstance.GetDomainClass().Id);
					global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachMetaModelHasMetaModelLibrariesInstance.GetDomainClass().Name + "!");
					relSerializer.Write(serializationContext, eachMetaModelHasMetaModelLibrariesInstance, writer);
				}
				writer.WriteEndElement();
			}
	
            /*
			// MetaModelHasView
			MetaModelHasView theMetaModelHasViewInstance = MetaModelHasView.GetLinkToView(element);
			if (!serializationContext.Result.Failed && theMetaModelHasViewInstance != null)
			{
				DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasViewInstance.GetDomainClass().Id);
				global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasViewInstance.GetDomainClass().Name + "!");
				relSerializer.Write(serializationContext, theMetaModelHasViewInstance, writer);
			}*/
	
			// MetaModelHasModelContexts
			global::System.Collections.ObjectModel.ReadOnlyCollection<MetaModelHasModelContexts> allMetaModelHasModelContextsInstances = MetaModelHasModelContexts.GetLinksToModelContexts(element);
			if (!serializationContext.Result.Failed && allMetaModelHasModelContextsInstances.Count > 0)
			{
				writer.WriteStartElement("modelContexts");
				foreach (MetaModelHasModelContexts eachMetaModelHasModelContextsInstance in allMetaModelHasModelContextsInstances)
				{
					if (serializationContext.Result.Failed)
						break;
	
					DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasModelContextsInstance.GetDomainClass().Id);
					global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachMetaModelHasModelContextsInstance.GetDomainClass().Name + "!");
					relSerializer.Write(serializationContext, eachMetaModelHasModelContextsInstance, writer);
				}
				writer.WriteEndElement();
			}
	
			// MetaModelHasPropertyGridEditors
			global::System.Collections.ObjectModel.ReadOnlyCollection<MetaModelHasPropertyGridEditors> allMetaModelHasPropertyGridEditorsInstances = MetaModelHasPropertyGridEditors.GetLinksToPropertyGridEditors(element);
			if (!serializationContext.Result.Failed && allMetaModelHasPropertyGridEditorsInstances.Count > 0)
			{
				writer.WriteStartElement("propertyGridEditors");
				global::System.Type typeofMetaModelHasPropertyGridEditors = typeof(MetaModelHasPropertyGridEditors);
				foreach (MetaModelHasPropertyGridEditors eachMetaModelHasPropertyGridEditorsInstance in allMetaModelHasPropertyGridEditorsInstances)
				{
					if (serializationContext.Result.Failed)
						break;
	
					if (eachMetaModelHasPropertyGridEditorsInstance.GetType() != typeofMetaModelHasPropertyGridEditors)
					{	// Derived relationships will be serialized in full-form.
						DslModeling::DomainClassXmlSerializer derivedRelSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasPropertyGridEditorsInstance.GetDomainClass().Id);
						global::System.Diagnostics.Debug.Assert(derivedRelSerializer != null, "Cannot find serializer for " + eachMetaModelHasPropertyGridEditorsInstance.GetDomainClass().Name + "!");			
						derivedRelSerializer.Write(serializationContext, eachMetaModelHasPropertyGridEditorsInstance, writer);
					}
					else
					{	// No need to serialize the relationship itself, just serialize the role-player directly.
						DslModeling::ModelElement targetElement = eachMetaModelHasPropertyGridEditorsInstance.PropertyGridEditor;
						DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
						global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");			
						targetSerializer.Write(serializationContext, targetElement, writer);
					}
				}
				writer.WriteEndElement();
			}

        }
        public static void SetLocks(MetaModel metaModel, Locks locks)
        {
            if (metaModel == null)
                return;

            ImmutabilityExtensionMethods.SetLocks(metaModel, locks);

            foreach (PropertyGridEditor p in metaModel.PropertyGridEditors)
                ImmutabilityExtensionMethods.SetLocks(p, locks);

            foreach (DomainType p in metaModel.DomainTypes)
                ImmutabilityExtensionMethods.SetLocks(p, locks);

            foreach (BaseModelContext p in metaModel.ModelContexts)
            {
                ImmutabilityExtensionMethods.SetLocks(p, locks);

                if (p is LibraryModelContext)
                {
                    foreach (DiagramClass d in (p as LibraryModelContext).DiagramClasses)
                    {
                        ImmutabilityExtensionMethods.SetLocks(d, locks);
                        foreach (PresentationElementClass pe in d.PresentationElements)
                            ImmutabilityExtensionMethods.SetLocks(pe, locks);
                    }

                    LibraryModelContext lib = p as LibraryModelContext;
                    if (lib.SerializationModel != null)
                    {
                        ImmutabilityExtensionMethods.SetLocks(lib.SerializationModel, locks);
                        foreach (SerializationClass s in lib.SerializationModel.Children)
                        {
                            if (s == null)
                                continue;

                            ImmutabilityExtensionMethods.SetLocks(s, locks);
                            foreach(SerializationAttributeElement attr in s.Attributes )
                                if( attr != null )
                                ImmutabilityExtensionMethods.SetLocks(attr, locks);

                            foreach(SerializationElement element in s.Children)
                                if( element is SerializationAttributeElement )
                                    ImmutabilityExtensionMethods.SetLocks(element, locks);

                            if (s is SerializedReferenceRelationship)
                            {
                                SerializedReferenceRelationship sRef = s as SerializedReferenceRelationship;
                                foreach(SerializedDomainRole role in sRef.SerializedDomainRoles)
                                    ImmutabilityExtensionMethods.SetLocks(role, locks);
                            }
                        }
                    }
                }
            }

            if (metaModel.AdditionalInformation != null)
            {
                ImmutabilityExtensionMethods.SetLocks(metaModel.AdditionalInformation, locks);

                if (metaModel.AdditionalInformation.FurtherInformation != null)
                {
                    ImmutabilityExtensionMethods.SetLocks(metaModel.AdditionalInformation.FurtherInformation, locks);
                    foreach (InformationItem p in metaModel.AdditionalInformation.FurtherInformation.InformationItems)
                        ImmutabilityExtensionMethods.SetLocks(p, locks);
                }

                if (metaModel.AdditionalInformation.Credits != null)
                {
                    ImmutabilityExtensionMethods.SetLocks(metaModel.AdditionalInformation.Credits, locks);
                    foreach (CreditItem p in metaModel.AdditionalInformation.Credits.CreditItems)
                        ImmutabilityExtensionMethods.SetLocks(p, locks);
                }
            }

            foreach (DomainClass p in metaModel.AllClasses)
            {
                ImmutabilityExtensionMethods.SetLocks(p, locks);
                foreach (DomainProperty prop in p.Properties)
                    ImmutabilityExtensionMethods.SetLocks(prop, locks);
            }

            foreach (DomainRelationship p in metaModel.AllRelationships)
            {
                ImmutabilityExtensionMethods.SetLocks(p, locks);
                foreach (DomainProperty prop in p.Properties)
                    ImmutabilityExtensionMethods.SetLocks(prop, locks);
                foreach (DomainRole prop in p.Roles)
                    ImmutabilityExtensionMethods.SetLocks(prop, locks);
            }

            if (metaModel.Validation != null)
                ImmutabilityExtensionMethods.SetLocks(metaModel.Validation, locks);
        }
Ejemplo n.º 34
0
        private void WriteChildElementsExtended(DslModeling::SerializationContext serializationContext, MetaModel element, global::System.Xml.XmlWriter writer)
        {
            // MetaModelHasDomainTypes
            global::System.Collections.ObjectModel.ReadOnlyCollection <MetaModelHasDomainTypes> allMetaModelHasDomainTypesInstances = MetaModelHasDomainTypes.GetLinksToDomainTypes(element);
            if (!serializationContext.Result.Failed && allMetaModelHasDomainTypesInstances.Count > 0)
            {
                writer.WriteStartElement("domainTypes");
                global::System.Type typeofMetaModelHasDomainTypes = typeof(MetaModelHasDomainTypes);
                foreach (MetaModelHasDomainTypes eachMetaModelHasDomainTypesInstance in allMetaModelHasDomainTypesInstances)
                {
                    if (serializationContext.Result.Failed)
                    {
                        break;
                    }

                    if (eachMetaModelHasDomainTypesInstance.GetType() != typeofMetaModelHasDomainTypes)
                    {                           // Derived relationships will be serialized in full-form.
                        DslModeling::DomainClassXmlSerializer derivedRelSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasDomainTypesInstance.GetDomainClass().Id);
                        global::System.Diagnostics.Debug.Assert(derivedRelSerializer != null, "Cannot find serializer for " + eachMetaModelHasDomainTypesInstance.GetDomainClass().Name + "!");
                        derivedRelSerializer.Write(serializationContext, eachMetaModelHasDomainTypesInstance, writer);
                    }
                    else
                    {                           // No need to serialize the relationship itself, just serialize the role-player directly.
                        DslModeling::ModelElement             targetElement    = eachMetaModelHasDomainTypesInstance.DomainType;
                        DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
                        global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
                        targetSerializer.Write(serializationContext, targetElement, writer);
                    }
                }
                writer.WriteEndElement();
            }

            // MetaModelHasValidation
            MetaModelHasValidation theMetaModelHasValidationInstance = MetaModelHasValidation.GetLinkToValidation(element);

            if (!serializationContext.Result.Failed && theMetaModelHasValidationInstance != null)
            {
                writer.WriteStartElement("validation");
                DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasValidationInstance.GetDomainClass().Id);
                global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasValidationInstance.GetDomainClass().Name + "!");
                relSerializer.Write(serializationContext, theMetaModelHasValidationInstance, writer);
                writer.WriteEndElement();
            }

            // MetaModelHasAdditionalInformation
            MetaModelHasAdditionalInformation theMetaModelHasAdditionalInformationInstance = MetaModelHasAdditionalInformation.GetLinkToAdditionalInformation(element);

            if (!serializationContext.Result.Failed && theMetaModelHasAdditionalInformationInstance != null)
            {
                writer.WriteStartElement("additionalInformation");
                DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasAdditionalInformationInstance.GetDomainClass().Id);
                global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasAdditionalInformationInstance.GetDomainClass().Name + "!");
                relSerializer.Write(serializationContext, theMetaModelHasAdditionalInformationInstance, writer);
                writer.WriteEndElement();
            }

            // MetaModelHasMetaModelLibraries
            global::System.Collections.ObjectModel.ReadOnlyCollection <MetaModelHasMetaModelLibraries> allMetaModelHasMetaModelLibrariesInstances = MetaModelHasMetaModelLibraries.GetLinksToMetaModelLibraries(element);
            if (!serializationContext.Result.Failed && allMetaModelHasMetaModelLibrariesInstances.Count > 0)
            {
                writer.WriteStartElement("metaModelLibraries");
                foreach (MetaModelHasMetaModelLibraries eachMetaModelHasMetaModelLibrariesInstance in allMetaModelHasMetaModelLibrariesInstances)
                {
                    if (serializationContext.Result.Failed)
                    {
                        break;
                    }

                    DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasMetaModelLibrariesInstance.GetDomainClass().Id);
                    global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachMetaModelHasMetaModelLibrariesInstance.GetDomainClass().Name + "!");
                    relSerializer.Write(serializationContext, eachMetaModelHasMetaModelLibrariesInstance, writer);
                }
                writer.WriteEndElement();
            }

            /*
             *          // MetaModelHasView
             *          MetaModelHasView theMetaModelHasViewInstance = MetaModelHasView.GetLinkToView(element);
             *          if (!serializationContext.Result.Failed && theMetaModelHasViewInstance != null)
             *          {
             *                  DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(theMetaModelHasViewInstance.GetDomainClass().Id);
             *                  global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + theMetaModelHasViewInstance.GetDomainClass().Name + "!");
             *                  relSerializer.Write(serializationContext, theMetaModelHasViewInstance, writer);
             *          }*/

            // MetaModelHasModelContexts
            global::System.Collections.ObjectModel.ReadOnlyCollection <MetaModelHasModelContexts> allMetaModelHasModelContextsInstances = MetaModelHasModelContexts.GetLinksToModelContexts(element);
            if (!serializationContext.Result.Failed && allMetaModelHasModelContextsInstances.Count > 0)
            {
                writer.WriteStartElement("modelContexts");
                foreach (MetaModelHasModelContexts eachMetaModelHasModelContextsInstance in allMetaModelHasModelContextsInstances)
                {
                    if (serializationContext.Result.Failed)
                    {
                        break;
                    }

                    DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasModelContextsInstance.GetDomainClass().Id);
                    global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachMetaModelHasModelContextsInstance.GetDomainClass().Name + "!");
                    relSerializer.Write(serializationContext, eachMetaModelHasModelContextsInstance, writer);
                }
                writer.WriteEndElement();
            }

            // MetaModelHasPropertyGridEditors
            global::System.Collections.ObjectModel.ReadOnlyCollection <MetaModelHasPropertyGridEditors> allMetaModelHasPropertyGridEditorsInstances = MetaModelHasPropertyGridEditors.GetLinksToPropertyGridEditors(element);
            if (!serializationContext.Result.Failed && allMetaModelHasPropertyGridEditorsInstances.Count > 0)
            {
                writer.WriteStartElement("propertyGridEditors");
                global::System.Type typeofMetaModelHasPropertyGridEditors = typeof(MetaModelHasPropertyGridEditors);
                foreach (MetaModelHasPropertyGridEditors eachMetaModelHasPropertyGridEditorsInstance in allMetaModelHasPropertyGridEditorsInstances)
                {
                    if (serializationContext.Result.Failed)
                    {
                        break;
                    }

                    if (eachMetaModelHasPropertyGridEditorsInstance.GetType() != typeofMetaModelHasPropertyGridEditors)
                    {                           // Derived relationships will be serialized in full-form.
                        DslModeling::DomainClassXmlSerializer derivedRelSerializer = serializationContext.Directory.GetSerializer(eachMetaModelHasPropertyGridEditorsInstance.GetDomainClass().Id);
                        global::System.Diagnostics.Debug.Assert(derivedRelSerializer != null, "Cannot find serializer for " + eachMetaModelHasPropertyGridEditorsInstance.GetDomainClass().Name + "!");
                        derivedRelSerializer.Write(serializationContext, eachMetaModelHasPropertyGridEditorsInstance, writer);
                    }
                    else
                    {                           // No need to serialize the relationship itself, just serialize the role-player directly.
                        DslModeling::ModelElement             targetElement    = eachMetaModelHasPropertyGridEditorsInstance.PropertyGridEditor;
                        DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
                        global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
                        targetSerializer.Write(serializationContext, targetElement, writer);
                    }
                }
                writer.WriteEndElement();
            }
        }
public void GenerateDomainModel(MetaModel dm)
{

        
        #line default
        #line hidden
        
        #line 22 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("namespace ");

        
        #line default
        #line hidden
        
        #line 23 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

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

        
        #line default
        #line hidden
        
        #line 26 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 26 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel\r\n");

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

	PushIndent("\t");
	this.Write(Utilities.Instance.GenerateComments(dm.Description));

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

        
        #line default
        #line hidden
        
        #line 32 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	this.Write(Utilities.Instance.GenerateResourceAttributes(dm, GeneratedResourceName));
	this.Write(Utilities.Instance.GenerateExtendsAttributes(dm));
	PopIndent();

        
        #line default
        #line hidden
        
        #line 36 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t[global::System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Maintainabil" +
        "ity\", \"CA1506:AvoidExcessiveClassCoupling\", Justification = \"Generated code.\")]\r" +
        "\n\t[DslModeling::DomainObjectId(\"");

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Id.ToString("D")));

        
        #line default
        #line hidden
        
        #line 38 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\")]\r\n\t[DslModeling::DependsOnDomainModel(typeof(DslEditorDiagrams::DiagramsDSLDom" +
        "ainModel))]\r\n\t[DslModeling::DependsOnDomainModel(typeof(DslEditorModeling::Domai" +
        "nModelDslEditorModeling))]\r\n\tpublic partial class ");

        
        #line default
        #line hidden
        
        #line 41 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 41 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel : DslEditorModeling::DomainModelBase\r\n\t{\r\n\t\t#region Constructor, doma" +
        "in model Id\r\n\r\n\t\t/// <summary>\r\n\t\t/// ");

        
        #line default
        #line hidden
        
        #line 46 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 46 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel domain model Id.\r\n\t\t/// </summary>\r\n\t\tpublic static readonly new glob" +
        "al::System.Guid DomainModelId = new System.Guid(\"");

        
        #line default
        #line hidden
        
        #line 48 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Id.ToString("D")));

        
        #line default
        #line hidden
        
        #line 48 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\");\r\n\r\n\t\t/// <summary>\r\n\t\t/// Constructor.\r\n\t\t/// </summary>\r\n\t\t/// <param name=\"" +
        "store\">Store containing the domain model.</param>\r\n\t\tpublic ");

        
        #line default
        #line hidden
        
        #line 54 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 54 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"DomainModel(DslModeling::Store store)
			: base(store, DomainModelId)
		{
			// Call the partial method to allow any required serialization setup to be done.
			this.InitializeSerialization(store);		
		}
	

		///<Summary>
		/// Defines a partial method that will be called from the constructor to
		/// allow any necessary serialization setup to be done.
		///</Summary>
		///<remarks>
		/// For a DSL created with the DSL Designer wizard, an implementation of this 
		/// method will be generated in the GeneratedCode\SerializationHelper.cs class.
		///</remarks>
		partial void InitializeSerialization(DslModeling::Store store);
		#endregion	
		#region Domain model reflection
		
");

        
        #line default
        #line hidden
        
        #line 74 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	List<AttributedDomainElement> classes = new List<AttributedDomainElement>();
	List<DomainRelationship> rels = new List<DomainRelationship>();
	List<DomainProperty> properties = new List<DomainProperty>();
	List<DomainClass> domainClasses = new List<DomainClass>();
	List<DomainRole> roles = new List<DomainRole>();
	int relationshipCount = 0;
	int classCount = 0;
	
	foreach(BaseModelContext c in dm.ModelContexts)
		if( c is LibraryModelContext )
		{
			LibraryModelContext modelContext = c as LibraryModelContext;
			foreach(DomainClass d in modelContext.Classes )
			{
				domainClasses.Add(d);
				classes.Add(d);
				properties.AddRange(d.Properties);
				classCount++;
			}
			
			foreach(DiagramClass d in modelContext.DiagramClasses)
				foreach(PresentationElementClass p in d.PresentationElements)
				{
					classes.Add(p);
					classCount++;
					
					properties.AddRange(p.Properties);
				}
			
			foreach(DomainRelationship r in modelContext.Relationships)
			{
				classes.Add(r);
				properties.AddRange(r.Properties);
				roles.AddRange(r.Roles);
				rels.Add(r);
			}
		}
		
	

	// If we have classes or relationships, override methods to return 
	// the list of generated classes, relationships, properties and roles.
	if(classes.Count > 0)
	{

        
        #line default
        #line hidden
        
        #line 119 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"		/// <summary>
		/// Gets the list of generated domain model types (classes, rules, relationships).
		/// </summary>
		/// <returns>List of types.</returns>
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1506:AvoidExcessiveClassCoupling"", Justification = ""Generated code."")]	
		protected sealed override global::System.Type[] GetGeneratedDomainModelTypes()
		{
			return new global::System.Type[]
			{
");

        
        #line default
        #line hidden
        
        #line 129 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		foreach(AttributedDomainElement c in classes)
		{

        
        #line default
        #line hidden
        
        #line 132 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 133 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(c.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 133 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("),\r\n");

        
        #line default
        #line hidden
        
        #line 134 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		}
		foreach(DiagramClass diagram in this.MetaModel.AllDiagramClasses)
		{			
			if( diagram is TemplatedDiagramViewModelOnly )
				continue;

        
        #line default
        #line hidden
        
        #line 140 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 141 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagram.Name));

        
        #line default
        #line hidden
        
        #line 141 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("),\r\n");

        
        #line default
        #line hidden
        
        #line 142 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"


		}
			
			if( CodeGenerationUtilities.NeedsShapeAddRule(dm) )
			{

        
        #line default
        #line hidden
        
        #line 148 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 149 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 149 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("ElementForShapesAdded),\r\n");

        
        #line default
        #line hidden
        
        #line 150 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			}
			if( CodeGenerationUtilities.NeedsShapeChangeRule(dm) )
			{

        
        #line default
        #line hidden
        
        #line 154 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 155 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 155 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("ElementForShapesChanged),\r\n");

        
        #line default
        #line hidden
        
        #line 156 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
				
			}
			if( CodeGenerationUtilities.NeedsShapeDeleteRule(dm) )
			{

        
        #line default
        #line hidden
        
        #line 160 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 161 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 161 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("ElementForShapesDeleted),\r\n");

        
        #line default
        #line hidden
        
        #line 162 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			}
			if( CodeGenerationUtilities.NeedsLinkRules(dm) )
			{

        
        #line default
        #line hidden
        
        #line 166 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 167 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 167 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("LinkForShapesAdded),\r\n\t\t\t\ttypeof(");

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

        
        #line default
        #line hidden
        
        #line 168 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("LinkForShapesChanged),\r\n\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 169 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 169 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("LinkForShapesDeleted),\r\n");

        
        #line default
        #line hidden
        
        #line 170 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			}
			if( CodeGenerationUtilities.NeedsMappingLinkRules(dm) )
			{

        
        #line default
        #line hidden
        
        #line 174 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\r\n\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 175 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 175 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("MappingLinkForShapesAdded),\r\n\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 176 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 176 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("MappingLinkForShapesChanged),\r\n\t\t\t\ttypeof(");

        
        #line default
        #line hidden
        
        #line 177 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 177 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("MappingLinkForShapesDeleted),\t\t\t\t\r\n");

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

			}		
		

        
        #line default
        #line hidden
        
        #line 181 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"			};
		}
		/// <summary>
		/// Gets the list of generated domain properties.
		/// </summary>
		/// <returns>List of property data.</returns>
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1506:AvoidExcessiveClassCoupling"", Justification = ""Generated code."")]	
		protected sealed override DomainMemberInfo[] GetGeneratedDomainProperties()
		{
			return new DomainMemberInfo[]
			{
");

        
        #line default
        #line hidden
        
        #line 193 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		foreach(DomainProperty p in properties)
		{

        
        #line default
        #line hidden
        
        #line 196 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tnew DomainMemberInfo(typeof(");

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Element.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("), \"");

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Name));

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\", ");

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Element.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Name));

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainPropertyId, typeof(");

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Element.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetPropertyHandlerName(p)));

        
        #line default
        #line hidden
        
        #line 197 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(")),\r\n");

        
        #line default
        #line hidden
        
        #line 198 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		}
		
		

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

        
        #line default
        #line hidden
        
        #line 205 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	}

        
        #line default
        #line hidden
        
        #line 209 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	if(roles.Count > 0)
	{

        
        #line default
        #line hidden
        
        #line 212 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t/// <summary>\r\n\t\t/// Gets the list of generated domain roles.\r\n\t\t/// </summary>" +
        "\r\n\t\t/// <returns>List of role data.</returns>\r\n\t\tprotected sealed override Domai" +
        "nRolePlayerInfo[] GetGeneratedDomainRoles()\r\n\t\t{\r\n\t\t\treturn new DomainRolePlayer" +
        "Info[]\r\n\t\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 221 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		foreach(DomainRole role in roles)
		{

        
        #line default
        #line hidden
        
        #line 224 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tnew DomainRolePlayerInfo(typeof(");

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Relationship.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("), \"");

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Name));

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\", ");

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Relationship.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Name));

        
        #line default
        #line hidden
        
        #line 225 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId),\r\n");

        
        #line default
        #line hidden
        
        #line 226 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		}

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

        
        #line default
        #line hidden
        
        #line 231 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	}

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"		#endregion
		#region Domain model advanced reflection
		/// <summary>
        /// Gets domain classes advanced reflection information.
        /// </summary>
        public override DslEditorModeling::DomainClassAdvancedInfo[] GetDomainClassAdvancedInfo()
		{
			return new DslEditorModeling::DomainClassAdvancedInfo[]
			{
");

        
        #line default
        #line hidden
        
        #line 243 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	foreach(DomainClass d in domainClasses)
	{

        
        #line default
        #line hidden
        
        #line 246 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tnew DslEditorModeling::DomainClassAdvancedInfo(");

        
        #line default
        #line hidden
        
        #line 247 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 247 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId)\r\n\t\t\t\t{\r\n\t\t\t\t\tIsAbstract = ");

        
        #line default
        #line hidden
        
        #line 249 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture((d.InheritanceModifier == InheritanceModifier.Abstract).ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 249 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\r\n\t\t\t\t}\r\n\t\t\t\t,\r\n");

        
        #line default
        #line hidden
        
        #line 252 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	}

        
        #line default
        #line hidden
        
        #line 254 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"	
			};
		}
		
        /// <summary>
        /// Gets domain relationships advanced reflection information.
        /// </summary>
        public override DslEditorModeling::DomainRelationshipAdvancedInfo[] GetDomainRelationshipAdvancedInfo()
		{
			return new DslEditorModeling::DomainRelationshipAdvancedInfo[]
			{
");

        
        #line default
        #line hidden
        
        #line 265 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	foreach(DomainRelationship r in rels )
	{
		if( r is EmbeddingRelationship )
		{
			EmbeddingRelationship emb = r as EmbeddingRelationship;

        
        #line default
        #line hidden
        
        #line 271 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tnew DslEditorModeling::EmbeddingRelationshipAdvancedInfo(");

        
        #line default
        #line hidden
        
        #line 272 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(emb.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 272 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 272 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(emb.PropagatesCopyToChild.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 272 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(", ");

        
        #line default
        #line hidden
        
        #line 272 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(emb.SerializedEmbeddingRelationship.IsTargetIncludedSubmodel.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 272 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(")\r\n\t\t\t\t{\r\n\t\t\t\t\tIsAbstract = ");

        
        #line default
        #line hidden
        
        #line 274 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture((emb.InheritanceModifier == InheritanceModifier.Abstract).ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 274 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tSourceElementDomainClassId = ");

        
        #line default
        #line hidden
        
        #line 275 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 275 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n\t\t\t\t\tTargetElementDomainClassId = ");

        
        #line default
        #line hidden
        
        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n\t\t\t\t\tSourceRoleId = ");

        
        #line default
        #line hidden
        
        #line 277 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 277 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 277 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.Name));

        
        #line default
        #line hidden
        
        #line 277 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId,\r\n\t\t\t\t\tTargetRoleId = ");

        
        #line default
        #line hidden
        
        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.Name));

        
        #line default
        #line hidden
        
        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId,\r\n\t\t\t\t\tSourceRoleMultiplicity = DslModeling::Multiplicity.");

        
        #line default
        #line hidden
        
        #line 279 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.Multiplicity.ToString()));

        
        #line default
        #line hidden
        
        #line 279 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tTargetRoleMultiplicity = DslModeling::Multiplicity.");

        
        #line default
        #line hidden
        
        #line 280 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.Multiplicity.ToString()));

        
        #line default
        #line hidden
        
        #line 280 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tSourceRoleIsUIBrowsable = ");

        
        #line default
        #line hidden
        
        #line 281 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.IsPropertyBrowsable.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 281 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tSourceRoleIsUIReadOnly = ");

        
        #line default
        #line hidden
        
        #line 282 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.IsPropertyUIReadOnly.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 282 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tSourceRoleIsGenerated = ");

        
        #line default
        #line hidden
        
        #line 283 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.IsPropertyGenerator.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 283 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tTargetRoleIsUIBrowsable = ");

        
        #line default
        #line hidden
        
        #line 284 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.IsPropertyBrowsable.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 284 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tTargetRoleIsUIReadOnly = ");

        
        #line default
        #line hidden
        
        #line 285 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.IsPropertyUIReadOnly.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 285 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tTargetRoleIsGenerated = ");

        
        #line default
        #line hidden
        
        #line 286 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.IsPropertyGenerator.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 286 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t}\r\n\t\t\t\t,\r\n");

        
        #line default
        #line hidden
        
        #line 289 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		}
		else if( r is ReferenceRelationship )
		{
			ReferenceRelationship reference = r as ReferenceRelationship;

        
        #line default
        #line hidden
        
        #line 294 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tnew DslEditorModeling::ReferenceRelationshipAdvancedInfo(");

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.PropagatesCopyToSource.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(", ");

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.PropagatesCopyToTarget.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(", ");

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.PropagatesCopyOnDeniedElementCopy.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(")\r\n\t\t\t\t{\r\n\t\t\t\t\tIsAbstract = ");

        
        #line default
        #line hidden
        
        #line 297 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture((reference.InheritanceModifier == InheritanceModifier.Abstract).ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 297 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tSourceElementDomainClassId = ");

        
        #line default
        #line hidden
        
        #line 298 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 298 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n\t\t\t\t\tTargetElementDomainClassId = ");

        
        #line default
        #line hidden
        
        #line 299 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 299 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n\t\t\t\t\tSourceRoleId = ");

        
        #line default
        #line hidden
        
        #line 300 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 300 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 300 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.Name));

        
        #line default
        #line hidden
        
        #line 300 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId,\r\n\t\t\t\t\tTargetRoleId = ");

        
        #line default
        #line hidden
        
        #line 301 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 301 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 301 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.Name));

        
        #line default
        #line hidden
        
        #line 301 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId,\r\n\t\t\t\t\tSourceRoleMultiplicity = DslModeling::Multiplicity.");

        
        #line default
        #line hidden
        
        #line 302 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.Multiplicity.ToString()));

        
        #line default
        #line hidden
        
        #line 302 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tTargetRoleMultiplicity = DslModeling::Multiplicity.");

        
        #line default
        #line hidden
        
        #line 303 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.Multiplicity.ToString()));

        
        #line default
        #line hidden
        
        #line 303 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tSourceRoleIsUIBrowsable = ");

        
        #line default
        #line hidden
        
        #line 304 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.IsPropertyBrowsable.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 304 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tSourceRoleIsUIReadOnly = ");

        
        #line default
        #line hidden
        
        #line 305 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.IsPropertyUIReadOnly.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 305 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tSourceRoleIsGenerated = ");

        
        #line default
        #line hidden
        
        #line 306 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Source.IsPropertyGenerator.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 306 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tTargetRoleIsUIBrowsable = ");

        
        #line default
        #line hidden
        
        #line 307 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.IsPropertyBrowsable.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 307 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tTargetRoleIsUIReadOnly = ");

        
        #line default
        #line hidden
        
        #line 308 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.IsPropertyUIReadOnly.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 308 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t\tTargetRoleIsGenerated = ");

        
        #line default
        #line hidden
        
        #line 309 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Target.IsPropertyGenerator.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 309 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(",\r\n\t\t\t\t}\r\n\t\t\t\t,\r\n");

        
        #line default
        #line hidden
        
        #line 312 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		}
	}

        
        #line default
        #line hidden
        
        #line 315 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"	
			};
		}
		
        /// <summary>
        /// Gets the embedding relationships order information (parent-child mappings in the order of the serialization model).
        /// </summary>
        public override DslEditorModeling::EmbeddingRelationshipOrderInfo[] GetEmbeddingRelationshipOrderInfo()
		{
			return new DslEditorModeling::EmbeddingRelationshipOrderInfo[] 
			{
");

        
        #line default
        #line hidden
        
        #line 326 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	foreach(BaseModelContext c in dm.ModelContexts)
		if( c is LibraryModelContext )
		{
			foreach(DomainClass dClass in (c as LibraryModelContext).Classes )
			{

        
        #line default
        #line hidden
        
        #line 332 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tnew DslEditorModeling::EmbeddingRelationshipOrderInfo(");

        
        #line default
        #line hidden
        
        #line 333 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 333 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId)\r\n\t\t\t\t{\r\n\t\t\t\t\tEmbeddingRelationships = new System.Guid[] \r\n\t\t\t\t\t{\r" +
        "\n");

        
        #line default
        #line hidden
        
        #line 337 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				List<EmbeddingRelationship> includedSubmodels = new List<EmbeddingRelationship>();
				SerializedDomainClass s = dClass.SerializedDomainClass;
				foreach(SerializationElement sElem in s.Children)
				{
					if( sElem is SerializedEmbeddingRelationship )
					{
						SerializedEmbeddingRelationship emb = sElem as SerializedEmbeddingRelationship;
						
						if( emb.IsTargetIncludedSubmodel)
							includedSubmodels.Add(emb.EmbeddingRelationship);


        
        #line default
        #line hidden
        
        #line 349 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 350 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(emb.EmbeddingRelationship.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 350 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n");

        
        #line default
        #line hidden
        
        #line 351 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"


					}
				}

        
        #line default
        #line hidden
        
        #line 355 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t},\r\n\t\t\t\t\t\r\n\t\t\t\t\tEmbeddingRelationshipsTargetIncludedSubmodel = new System.Gu" +
        "id[] \r\n\t\t\t\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 360 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				foreach(EmbeddingRelationship emb in includedSubmodels)
				{

        
        #line default
        #line hidden
        
        #line 363 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 364 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(emb.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 364 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n");

        
        #line default
        #line hidden
        
        #line 365 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				}

        
        #line default
        #line hidden
        
        #line 367 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t}\r\n\t\t\t\t},\r\n");

        
        #line default
        #line hidden
        
        #line 370 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			}
		}

        
        #line default
        #line hidden
        
        #line 373 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"			};
		}

        /// <summary>
        /// Gets the model context informations.
        /// </summary>
        public override DslEditorModeling::ModelContextInfo[] GetModelContextInfo()
		{
			return new DslEditorModeling::ModelContextInfo[] 
			{
");

        
        #line default
        #line hidden
        
        #line 384 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	foreach(BaseModelContext c in dm.ModelContexts)
		if( c is ModelContext )
		{
			DomainClass contextDomainModel = null;
			foreach(DomainClass d in (c as ModelContext).Classes )
			{
				if( d.IsDomainModel )
				{
					contextDomainModel = d;
					break;
				}
			}
			if( contextDomainModel == null )
				continue;

        
        #line default
        #line hidden
        
        #line 399 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tnew DslEditorModeling::ModelContextInfo(");

        
        #line default
        #line hidden
        
        #line 400 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(c.Name));

        
        #line default
        #line hidden
        
        #line 400 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("ModelContext.DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 400 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(contextDomainModel.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 400 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId),\r\n");

        
        #line default
        #line hidden
        
        #line 401 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		}

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

        
        #line default
        #line hidden
        
        #line 407 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		List<DiagramClass> diagramClassList = new List<DiagramClass>();
		List<ShapeClass> shapeClassList = new List<ShapeClass>();
		List<RelationshipShapeClass> rsShapeClassList = new List<RelationshipShapeClass>();
		List<MappingRelationshipShapeClass> mapRsShapeClassList = new List<MappingRelationshipShapeClass>();
		List<AttributedDomainElement> modelElementsList = new List<AttributedDomainElement>();
		Dictionary<Guid, List<DomainRole>> relsSource = new Dictionary<Guid, List<DomainRole>>();
		Dictionary<Guid, List<DomainRole>> relsTarget = new Dictionary<Guid, List<DomainRole>>();
		Dictionary<Guid, List<DomainRole>> mapRelsSource = new Dictionary<Guid, List<DomainRole>>();
		Dictionary<Guid, List<DomainRole>> mapRelsTarget = new Dictionary<Guid, List<DomainRole>>();
		foreach(DiagramClass diagramClass in dm.AllDiagramClasses)
		{
			if( diagramClass is TemplatedDiagramViewModelOnly )
				continue;			
			
			//if( !diagramClass.IsCustom )
			diagramClassList.Add(diagramClass);
			
			// collect all shapes
			foreach(PresentationElementClass p in diagramClass.PresentationElements)
			{
				if( p is ShapeClass )
					if( (p as ShapeClass).DomainClass != null )
					{
						shapeClassList.Add(p as ShapeClass);
						
						List<DomainClass> sClasses = CodeGenerationUtilities.GetAllDerivedClassesWithSelf((p as ShapeClass).DomainClass);
						foreach(DomainClass s in sClasses)
						{
							if( !modelElementsList.Contains(s))
								modelElementsList.Add(s);
						
							if( !relsSource.ContainsKey((p as ShapeClass).DomainClass.Id) )
								relsSource.Add((p as ShapeClass).DomainClass.Id, new List<DomainRole>());
							if( !relsTarget.ContainsKey((p as ShapeClass).DomainClass.Id) )
								relsTarget.Add((p as ShapeClass).DomainClass.Id, new List<DomainRole>());
							if( !mapRelsSource.ContainsKey((p as ShapeClass).DomainClass.Id) )
								mapRelsSource.Add((p as ShapeClass).DomainClass.Id, new List<DomainRole>());
							if( !mapRelsTarget.ContainsKey((p as ShapeClass).DomainClass.Id) )
								mapRelsTarget.Add((p as ShapeClass).DomainClass.Id, new List<DomainRole>());
						}
					}
			}
			foreach(PresentationElementClass p in diagramClass.PresentationElements)
			{
				if( p is MappingRelationshipShapeClass)
					if( (p as MappingRelationshipShapeClass).DomainClass != null &&
						(p as MappingRelationshipShapeClass).Source != null &&
						(p as MappingRelationshipShapeClass).Target != null )
					{
						mapRsShapeClassList.Add(p as MappingRelationshipShapeClass);
						if( !modelElementsList.Contains((p as MappingRelationshipShapeClass).DomainClass))
							modelElementsList.Add((p as MappingRelationshipShapeClass).DomainClass);
						
						List<DomainRelationship> relsDe = CodeGenerationUtilities.GetAllDerivedRSWithSelf((p as MappingRelationshipShapeClass).Source);
						foreach(DomainRelationship d in relsDe)
						{
							List<DomainClass> sClasses = CodeGenerationUtilities.GetAllDerivedClassesWithSelf(d.Target.RolePlayer as DomainClass);
							foreach(DomainClass s in sClasses)
								if(mapRelsSource.ContainsKey(s.Id) )
									mapRelsSource[s.Id].Add(d.Target);
						}
						
						relsDe = CodeGenerationUtilities.GetAllDerivedRSWithSelf((p as MappingRelationshipShapeClass).Target);
						foreach(DomainRelationship d in relsDe)
						{
							List<DomainClass> sClasses = CodeGenerationUtilities.GetAllDerivedClassesWithSelf(d.Target.RolePlayer as DomainClass);
							foreach(DomainClass s in sClasses)
								if(mapRelsTarget.ContainsKey(s.Id) )
									mapRelsTarget[s.Id].Add(d.Target);
						}
					}
					
				if( p is RelationshipShapeClass )
					if( (p as RelationshipShapeClass).ReferenceRelationship != null )
					{
						rsShapeClassList.Add(p as RelationshipShapeClass);
						List<DomainRelationship> relsDe = CodeGenerationUtilities.GetAllDerivedRSWithSelf((p as RelationshipShapeClass).ReferenceRelationship);
						foreach(DomainRelationship d in relsDe)
						{
							if( !modelElementsList.Contains(d) )
								modelElementsList.Add(d);
						
							if(relsSource.ContainsKey(d.Source.RolePlayer.Id) )
								relsSource[d.Source.RolePlayer.Id].Add(d.Source);
							if(relsTarget.ContainsKey(d.Target.RolePlayer.Id) )
								relsTarget[d.Target.RolePlayer.Id].Add(d.Target);
						}
					}
			}
		}
	

        
        #line default
        #line hidden
        
        #line 499 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t#region Diagrams model advanced reflection\r\n\t\tprivate class ");

        
        #line default
        #line hidden
        
        #line 501 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 501 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"DiagramDomainDataDirectory : DslEditorDiagrams::DiagramDomainDataDirectory
		{
			/// <summary>
        	/// Gets the diagram class information.
        	/// </summary>
        	/// <returns>Diagram class info.</returns>
        	public override DslEditorDiagrams::DiagramClassInfo[] GetDiagramClassInfo()
			{
				return new DslEditorDiagrams::DiagramClassInfo[]
				{
");

        
        #line default
        #line hidden
        
        #line 511 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			foreach(DiagramClass diagramClass in diagramClassList)
			{

        
        #line default
        #line hidden
        
        #line 514 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\tnew DslEditorDiagrams::DiagramClassInfo(");

        
        #line default
        #line hidden
        
        #line 515 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

        
        #line default
        #line hidden
        
        #line 515 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 515 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.Name));

        
        #line default
        #line hidden
        
        #line 515 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, DslEditorDiagrams::DiagramVisualizationBehavior.");

        
        #line default
        #line hidden
        
        #line 515 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(diagramClass.VisualizationBehavior));

        
        #line default
        #line hidden
        
        #line 515 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("),\r\n");

        
        #line default
        #line hidden
        
        #line 516 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			}

        
        #line default
        #line hidden
        
        #line 518 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"				};
			}

			/// <summary>
        	/// Gets the shape class information.
        	/// </summary>
        	/// <returns>Shape class info.</returns>
        	public override DslEditorDiagrams::ShapeClassInfo[] GetShapeClassInfo()
			{
				return new DslEditorDiagrams::ShapeClassInfo[]
				{
");

        
        #line default
        #line hidden
        
        #line 530 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			foreach(ShapeClass shapeClass in shapeClassList)
			{
				DomainClass d = shapeClass.DomainClass;
				//List<DomainClass> sClasses = CodeGenerationUtilities.GetAllDerivedClassesWithSelf(shapeClass.DomainClass);
				//foreach(DomainClass d in sClasses)
				//{
					//if( d.InheritanceModifier == InheritanceModifier.Abstract )
					//	continue;
					
					//if( d.ShapeClasses.Count > 0 )
					//	continue;

        
        #line default
        #line hidden
        
        #line 542 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\tnew DslEditorDiagrams::ShapeClassInfo(");

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.DiagramClass.Name));

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.UseInDependencyView.ToString().ToLower()));

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(")\r\n\t\t\t\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 545 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				if( shapeClass.Parent != null )
				{

        
        #line default
        #line hidden
        
        #line 548 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\tParentShapeClassType = ");

        
        #line default
        #line hidden
        
        #line 549 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Parent.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 549 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n");

        
        #line default
        #line hidden
        
        #line 550 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				}
				if( !String.IsNullOrEmpty(shapeClass.MenuIconUri) )
				{

        
        #line default
        #line hidden
        
        #line 554 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\tIconURL = \"");

        
        #line default
        #line hidden
        
        #line 555 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.MenuIconUri));

        
        #line default
        #line hidden
        
        #line 555 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\",\r\n");

        
        #line default
        #line hidden
        
        #line 556 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				}
				if( shapeClass.BaseShape != null )
				{

        
        #line default
        #line hidden
        
        #line 560 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\tBaseShape = ");

        
        #line default
        #line hidden
        
        #line 561 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.BaseShape.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 561 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n");

        
        #line default
        #line hidden
        
        #line 562 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				}				
					if( relsSource[shapeClass.DomainClass.Id].Count > 0 )
					{

        
        #line default
        #line hidden
        
        #line 566 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\tRelationshipSourceRoleTypes = new System.Collections.Generic.List<System.Gu" +
        "id>(new System.Guid[]\r\n                        {\r\n");

        
        #line default
        #line hidden
        
        #line 569 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

						foreach(DomainRole dmr in relsSource[shapeClass.DomainClass.Id])
						{

        
        #line default
        #line hidden
        
        #line 572 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 573 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dmr.Relationship.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 573 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 573 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dmr.Name));

        
        #line default
        #line hidden
        
        #line 573 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId,\r\n");

        
        #line default
        #line hidden
        
        #line 574 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

						}

        
        #line default
        #line hidden
        
        #line 576 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("                        }),\r\n");

        
        #line default
        #line hidden
        
        #line 578 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					}
					if( relsTarget[shapeClass.DomainClass.Id].Count > 0 )
					{

        
        #line default
        #line hidden
        
        #line 582 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\tRelationshipTargetRoleTypes = new System.Collections.Generic.List<System.Gu" +
        "id>(new System.Guid[]\r\n                        {\r\n");

        
        #line default
        #line hidden
        
        #line 585 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

						foreach(DomainRole dmr in relsTarget[shapeClass.DomainClass.Id])
						{

        
        #line default
        #line hidden
        
        #line 588 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 589 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dmr.Relationship.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 589 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 589 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dmr.Name));

        
        #line default
        #line hidden
        
        #line 589 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId,\r\n");

        
        #line default
        #line hidden
        
        #line 590 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

						}

        
        #line default
        #line hidden
        
        #line 592 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("                        }),\r\n");

        
        #line default
        #line hidden
        
        #line 594 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					}	
					if( mapRelsSource[shapeClass.DomainClass.Id].Count > 0 )
					{

        
        #line default
        #line hidden
        
        #line 598 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\tMappingRelationshipSourceRoleTypes = new System.Collections.Generic.List<Sy" +
        "stem.Guid>(new System.Guid[]\r\n                        {\r\n");

        
        #line default
        #line hidden
        
        #line 601 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

						foreach(DomainRole dmr in mapRelsSource[shapeClass.DomainClass.Id])
						{

        
        #line default
        #line hidden
        
        #line 604 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 605 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dmr.Relationship.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 605 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 605 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dmr.Name));

        
        #line default
        #line hidden
        
        #line 605 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId,\r\n");

        
        #line default
        #line hidden
        
        #line 606 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

						}

        
        #line default
        #line hidden
        
        #line 608 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("                        }),\r\n");

        
        #line default
        #line hidden
        
        #line 610 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					}
					if( mapRelsTarget[shapeClass.DomainClass.Id].Count > 0 )
					{

        
        #line default
        #line hidden
        
        #line 614 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\tMappingRelationshipTargetRoleTypes = new System.Collections.Generic.List<Sy" +
        "stem.Guid>(new System.Guid[]\r\n                        {\r\n");

        
        #line default
        #line hidden
        
        #line 617 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

						foreach(DomainRole dmr in mapRelsTarget[shapeClass.DomainClass.Id])
						{

        
        #line default
        #line hidden
        
        #line 620 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 621 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dmr.Relationship.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 621 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 621 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dmr.Name));

        
        #line default
        #line hidden
        
        #line 621 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId,\r\n");

        
        #line default
        #line hidden
        
        #line 622 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

						}

        
        #line default
        #line hidden
        
        #line 624 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("                        }),\r\n");

        
        #line default
        #line hidden
        
        #line 626 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					}
					
				

        
        #line default
        #line hidden
        
        #line 630 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t},\r\n");

        
        #line default
        #line hidden
        
        #line 632 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				//}
			}

        
        #line default
        #line hidden
        
        #line 635 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"				
				};
			}

        	/// <summary>
        	/// Gets the rs shape class information.
        	/// </summary>
        	/// <returns>RSShape class info.</returns>
        	public override DslEditorDiagrams::RelationshipShapeInfo[] GetRelationshipShapeInfo()
			{
				return new DslEditorDiagrams::RelationshipShapeInfo[]
				{
");

        
        #line default
        #line hidden
        
        #line 647 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			foreach(RelationshipShapeClass shapeClass in rsShapeClassList)
			{
				List<DomainRelationship> relsDe = CodeGenerationUtilities.GetAllDerivedRSWithSelf(shapeClass.ReferenceRelationship);
				foreach(DomainRelationship d in relsDe)
				{

        
        #line default
        #line hidden
        
        #line 653 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\tnew DslEditorDiagrams::RelationshipShapeInfo(");

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.DiagramClass.Name));

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId),\r\n");

        
        #line default
        #line hidden
        
        #line 655 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

				}
			}

        
        #line default
        #line hidden
        
        #line 658 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"				
				};
			}
			
        	/// <summary>
        	/// Gets the mapping rs shape class information.
        	/// </summary>
        	/// <returns>MappingRSShape class info.</returns>
        	public override DslEditorDiagrams::MappingRelationshipShapeInfo[] GetMappingRelationshipShapeInfo()
			{
				return new DslEditorDiagrams::MappingRelationshipShapeInfo[]
				{
");

        
        #line default
        #line hidden
        
        #line 670 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			foreach(MappingRelationshipShapeClass shapeClass in mapRsShapeClassList)
			{

        
        #line default
        #line hidden
        
        #line 673 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\tnew DslEditorDiagrams::MappingRelationshipShapeInfo(");

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Namespace));

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.DiagramClass.Name));

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.DomainClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Source.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId, ");

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Target.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 674 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n\t\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 675 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Source.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 675 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 675 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Source.Source.Name));

        
        #line default
        #line hidden
        
        #line 675 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId, ");

        
        #line default
        #line hidden
        
        #line 675 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Target.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 675 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".");

        
        #line default
        #line hidden
        
        #line 675 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(shapeClass.Target.Source.Name));

        
        #line default
        #line hidden
        
        #line 675 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainRoleId)\r\n");

        
        #line default
        #line hidden
        
        #line 676 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			}

        
        #line default
        #line hidden
        
        #line 678 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"					
				};
			}
			
        	/// <summary>
        	/// Gets the shape class information.
        	/// </summary>
        	/// <returns>Shape class info.</returns>
        	public override System.Guid[] GetClassesRelevantForSM()
			{
				return new System.Guid[]
				{
");

        
        #line default
        #line hidden
        
        #line 690 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			foreach(AttributedDomainElement element in modelElementsList)
			{

        
        #line default
        #line hidden
        
        #line 693 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 694 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(element.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 694 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(".DomainClassId,\r\n");

        
        #line default
        #line hidden
        
        #line 695 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			}

        
        #line default
        #line hidden
        
        #line 697 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"					
				};
			}
		}
		
		/// <summary>
        /// Gets data extensions.
        /// </summary>
        /// <returns>List of data extensions or null.</returns>
		public override DslEditorModeling::IDomainDataExtensionDirectory[] GetDataExtensions()
        {
            return new DslEditorModeling::IDomainDataExtensionDirectory[]
			{
				new ");

        
        #line default
        #line hidden
        
        #line 710 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 710 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DiagramDomainDataDirectory()\r\n\t\t\t};\r\n        }\r\n\t\t#endregion\r\n");

        
        #line default
        #line hidden
        
        #line 714 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

		
	// Generate code that is used to create the classes and relationships
	// by reflective means.
	if(classes.Count > 0)
	{

        
        #line default
        #line hidden
        
        #line 720 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"		#region Factory methods
		private static global::System.Collections.Generic.Dictionary<global::System.Type, int> createElementMap;

		/// <summary>
		/// Creates an element of specified type.
		/// </summary>
		/// <param name=""partition"">Partition where element is to be created.</param>
		/// <param name=""elementType"">Element type which belongs to this domain model.</param>
		/// <param name=""propertyAssignments"">New element property assignments.</param>
		/// <returns>Created element.</returns>
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"")]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1506:AvoidExcessiveClassCoupling"", Justification = ""Generated code."")]	
		public sealed override DslModeling::ModelElement CreateElement(DslModeling::Partition partition, global::System.Type elementType, DslModeling::PropertyAssignment[] propertyAssignments)
		{
			if (elementType == null) throw new global::System.ArgumentNullException(""elementType"");
			
			if (createElementMap == null)
			{
				createElementMap = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(");

        
        #line default
        #line hidden
        
        #line 739 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(classCount));

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

        
        #line default
        #line hidden
        
        #line 740 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			int count = 0;
			foreach(AttributedDomainElement c in classes)
			{
				if((!(c is DomainRelationship)) && c.InheritanceModifier != InheritanceModifier.Abstract)
				{

        
        #line default
        #line hidden
        
        #line 746 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tcreateElementMap.Add(typeof(");

        
        #line default
        #line hidden
        
        #line 747 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(c.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 747 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("), ");

        
        #line default
        #line hidden
        
        #line 747 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(count));

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

        
        #line default
        #line hidden
        
        #line 748 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					count++;
				}
			}

        
        #line default
        #line hidden
        
        #line 752 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t}\r\n\t\t\tint index;\r\n\t\t\tif (!createElementMap.TryGetValue(elementType, out index)" +
        ")\r\n\t\t\t{\r\n\t\t\t\t// construct exception error message\t\t\r\n\t\t\t\tstring exceptionError =" +
        " string.Format(\r\n\t\t\t\t\t\t\t\tglobal::System.Globalization.CultureInfo.CurrentCulture" +
        ",\r\n\t\t\t\t\t\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 760 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"UnrecognizedElementType\"),\r\n\t\t\t\t\t" +
        "\t\t\telementType.Name);\r\n\t\t\t\tthrow new global::System.ArgumentException(exceptionE" +
        "rror, \"elementType\");\r\n\t\t\t}\r\n\t\t\tswitch (index)\r\n\t\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 766 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			count = 0;
			foreach(AttributedDomainElement c in classes)
			{
				if((!(c is DomainRelationship)) && c.InheritanceModifier != InheritanceModifier.Abstract)
				{
					if(c.HasCustomConstructor)
					{

        
        #line default
        #line hidden
        
        #line 774 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t// A constructor was not generated for ");

        
        #line default
        #line hidden
        
        #line 775 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(c.Name));

        
        #line default
        #line hidden
        
        #line 775 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(" because it had HasCustomConstructor\r\n\t\t\t\t// set to true. Please provide the cons" +
        "tructor below.\r\n");

        
        #line default
        #line hidden
        
        #line 777 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					}

        
        #line default
        #line hidden
        
        #line 779 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tcase ");

        
        #line default
        #line hidden
        
        #line 780 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(count));

        
        #line default
        #line hidden
        
        #line 780 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(": return new ");

        
        #line default
        #line hidden
        
        #line 780 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(c.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 780 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("(partition, propertyAssignments);\r\n");

        
        #line default
        #line hidden
        
        #line 781 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					count++;
				}
			}

        
        #line default
        #line hidden
        
        #line 785 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"				default: return null;
			}
		}

		private static global::System.Collections.Generic.Dictionary<global::System.Type, int> createElementLinkMap;

		/// <summary>
		/// Creates an element link of specified type.
		/// </summary>
		/// <param name=""partition"">Partition where element is to be created.</param>
		/// <param name=""elementLinkType"">Element link type which belongs to this domain model.</param>
		/// <param name=""roleAssignments"">List of relationship role assignments for the new link.</param>
		/// <param name=""propertyAssignments"">New element property assignments.</param>
		/// <returns>Created element link.</returns>
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"")]
		public sealed override DslModeling::ElementLink CreateElementLink(DslModeling::Partition partition, global::System.Type elementLinkType, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
		{
			if (elementLinkType == null) throw new global::System.ArgumentNullException(""elementLinkType"");
			if (roleAssignments == null) throw new global::System.ArgumentNullException(""roleAssignments"");
			
			if (createElementLinkMap == null)
			{
				createElementLinkMap = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(");

        
        #line default
        #line hidden
        
        #line 808 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(relationshipCount));

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

        
        #line default
        #line hidden
        
        #line 809 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			count = 0;
			foreach(AttributedDomainElement r in classes)
			{
				if(r is DomainRelationship && r.InheritanceModifier != InheritanceModifier.Abstract)
				{

        
        #line default
        #line hidden
        
        #line 815 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tcreateElementLinkMap.Add(typeof(");

        
        #line default
        #line hidden
        
        #line 816 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 816 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("), ");

        
        #line default
        #line hidden
        
        #line 816 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(count));

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

        
        #line default
        #line hidden
        
        #line 817 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					count++;
				}
			}

        
        #line default
        #line hidden
        
        #line 821 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"			}
			int index;
			if (!createElementLinkMap.TryGetValue(elementLinkType, out index))
			{
				// construct exception error message
				string exceptionError = string.Format(
								global::System.Globalization.CultureInfo.CurrentCulture,
								");

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

        
        #line default
        #line hidden
        
        #line 829 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel.SingletonResourceManager.GetString(\"UnrecognizedElementLinkType\"),\r\n\t" +
        "\t\t\t\t\t\t\telementLinkType.Name);\r\n\t\t\t\tthrow new global::System.ArgumentException(ex" +
        "ceptionError, \"elementLinkType\");\r\n\t\t\r\n\t\t\t}\r\n\t\t\tswitch (index)\r\n\t\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 836 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

			count = 0;
			foreach(AttributedDomainElement r in classes)
			{
				if(r is DomainRelationship && r.InheritanceModifier != InheritanceModifier.Abstract)
				{
					if(r.HasCustomConstructor)
					{

        
        #line default
        #line hidden
        
        #line 844 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\t// A constructor was not generated for ");

        
        #line default
        #line hidden
        
        #line 845 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.Name));

        
        #line default
        #line hidden
        
        #line 845 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(" because it had HasCustomConstructor\r\n\t\t\t\t// set to true. Please provide the cons" +
        "tructor below.\r\n");

        
        #line default
        #line hidden
        
        #line 847 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					}

        
        #line default
        #line hidden
        
        #line 849 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tcase ");

        
        #line default
        #line hidden
        
        #line 850 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(count));

        
        #line default
        #line hidden
        
        #line 850 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(": return new ");

        
        #line default
        #line hidden
        
        #line 850 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(r.GetRelativeName(dm.Namespace, true)));

        
        #line default
        #line hidden
        
        #line 850 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("(partition, roleAssignments, propertyAssignments);\r\n");

        
        #line default
        #line hidden
        
        #line 851 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

					count++;
				}
			}

        
        #line default
        #line hidden
        
        #line 855 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t\t\tdefault: return null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t#endregion\t\r\n");

        
        #line default
        #line hidden
        
        #line 860 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	}
	
	if(!String.IsNullOrEmpty(dm.GeneratedResourceName))
	{

        
        #line default
        #line hidden
        
        #line 865 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t#region Resource manager\r\n\t\r\n\t\tprivate static global::System.Resources.Resource" +
        "Manager resourceManager;\r\n\t\r\n\t\t/// <summary>\r\n\t\t/// The base name of this model\'" +
        "s resources.\r\n\t\t/// </summary>\r\n\t\tpublic const string ResourceBaseName = \"");

        
        #line default
        #line hidden
        
        #line 873 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GeneratedResourceName));

        
        #line default
        #line hidden
        
        #line 873 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@""";
	
		/// <summary>
		/// Gets the DomainModel's ResourceManager. If the ResourceManager does not already exist, then it is created.
		/// </summary>
		public override global::System.Resources.ResourceManager ResourceManager
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return ");

        
        #line default
        #line hidden
        
        #line 883 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 883 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(@"DomainModel.SingletonResourceManager;
			}
		}

		/// <summary>
		/// Gets the Singleton ResourceManager for this domain model.
		/// </summary>
		public static global::System.Resources.ResourceManager SingletonResourceManager
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				if (");

        
        #line default
        #line hidden
        
        #line 895 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 895 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel.resourceManager == null)\r\n\t\t\t\t{\r\n\t\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 897 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 897 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel.resourceManager = new global::System.Resources.ResourceManager(\r\n    " +
        "                    ResourceBaseName, typeof(");

        
        #line default
        #line hidden
        
        #line 898 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 898 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel).Assembly);\r\n\t\t\t\t}\r\n\t\t\t\treturn ");

        
        #line default
        #line hidden
        
        #line 900 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dm.Name));

        
        #line default
        #line hidden
        
        #line 900 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("DomainModel.resourceManager;\r\n\t\t\t}\r\n\t\t}\r\n\t\t#endregion\r\n");

        
        #line default
        #line hidden
        
        #line 904 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	}

        
        #line default
        #line hidden
        
        #line 906 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t#region Copy/Remove closures\r\n");

        
        #line default
        #line hidden
        
        #line 908 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	PushIndent("\t");
	PushIndent("\t");
	// Generate properties to get the copy and delete closures for this
	// domain model.
	this.Write(ClosuresGenerator.Instance.GenerateClosureProperties(dm));
	PopIndent();
	PopIndent();

        
        #line default
        #line hidden
        
        #line 916 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"
this.Write("\t\t#endregion\r\n\t}\r\n\t\r\n\t#region Copy/Remove closure classes\r\n");

        
        #line default
        #line hidden
        
        #line 921 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	// Generate the delete and copy closures for this domain model.
	PushIndent("\t");
	this.Write(ClosuresGenerator.Instance.GenerateDeleteClosure(dm));
	this.Write(ClosuresGenerator.Instance.GenerateCopyClosure(dm));
	PopIndent();

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

        
        #line default
        #line hidden
        
        #line 931 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainModelGenerator.tt"

	// Generate code for enumerations in this domain model
	foreach(DomainType domainType in dm.DomainTypes)
	{
		if(domainType is DomainEnumeration)
		{
			this.Write(DomainEnumerationGenerator.Instance.GenerateDomainEnumeration(dm, (DomainEnumeration)domainType));
		}
	}	
}
Ejemplo n.º 36
0
        public override void SaveModel(DslModeling::SerializationResult serializationResult, MetaModel modelRoot, string fileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
        {
            base.SaveModel(serializationResult, modelRoot, fileName, encoding, writeOptionalPropertiesWithDefaultValue);

            System.IO.FileInfo info = new System.IO.FileInfo(fileName);
            string fileNameDiagram = info.DirectoryName + "\\" + info.Name.Remove(info.Name.Length - info.Extension.Length, info.Extension.Length) + DiagramExtension;

            // save view information
            using (global::System.IO.MemoryStream newFileContent = new global::System.IO.MemoryStream())
            {
                DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(modelRoot.Store);

                DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, fileName, serializationResult);
                this.InitializeSerializationContext(modelRoot.Partition, serializationContext, false);
                // MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.
                serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
                global::System.Xml.XmlWriterSettings settings = LanguageDSLSerializationHelper.Instance.CreateXmlWriterSettings(serializationContext, false, encoding);
                using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(newFileContent, settings))
                {
                    ViewSerializer serializer = directory.GetSerializer(View.DomainClassId) as ViewSerializer;
                    serializer.Write(serializationContext, modelRoot.View, writer);
                }

                if (!serializationResult.Failed && newFileContent != null)
                {	// Only write the content if there's no error encountered during serialization.
                    using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(fileNameDiagram, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
                    {
                        using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
                        {
                            writer.Write(newFileContent.ToArray());
                        }
                    }
                }
            }
        }