Ejemplo n.º 1
0
        /// <summary>
        /// Updates current element properties as well as the properties of all derived elements as well as properties of derived elements of derived elements
        /// </summary>
        /// <param name="element"></param>
        public static void UpdateDerivedElementsSerializationProperties(AttributedDomainElement element)
        {
            if (element is DomainClass)
            {
                UpdateSerializationDomainProperties(element.Store, (element as DomainClass).SerializedDomainClass, element);

                LinkedElementCollection <DomainClass> classes = DomainClassReferencesBaseClass.GetDerivedClasses(element as DomainClass);
                foreach (DomainClass domainClass in classes)
                {
                    UpdateDerivedElementsSerializationProperties(domainClass);
                }
            }
            else if (element is DomainRelationship)
            {
                if (element is ReferenceRelationship)
                {
                    UpdateSerializationDomainProperties(element.Store, (element as ReferenceRelationship).SerializedReferenceRelationship, element);
                }

                if (element is EmbeddingRelationship)
                {
                    UpdateSerializationDomainProperties(element.Store, (element as EmbeddingRelationship).SerializedEmbeddingRelationship, element);
                }

                LinkedElementCollection <DomainRelationship> classes = DomainRelationshipReferencesBaseRelationship.GetDerivedRelationships(element as DomainRelationship);
                foreach (DomainRelationship d in classes)
                {
                    UpdateDerivedElementsSerializationProperties(d);
                }
            }
        }
Ejemplo n.º 2
0
        public override void ElementDeleting(ElementDeletingEventArgs e)
        {
            if (e.ModelElement != null)
            {
                if (e.ModelElement.Store.TransactionManager.CurrentTransaction != null)
                {
                    if (e.ModelElement.Store.TransactionManager.CurrentTransaction.IsSerializing)
                    {
                        return;
                    }
                }
            }

            if (e.ModelElement == null)
            {
                return;
            }

            if (ImmutabilityExtensionMethods.GetLocks(e.ModelElement) != Locks.None)
            {
                return;
            }

            DomainProperty domainProperty = e.ModelElement as DomainProperty;

            if (domainProperty != null)
            {
                AttributedDomainElement element = domainProperty.Element;
                domainProperty.Element = null;

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

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

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

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

            return derivedClassesCollection;
        }
Ejemplo n.º 4
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            if (e.ModelElement != null)
            {
                if (e.ModelElement.Store.TransactionManager.CurrentTransaction != null)
                {
                    if (e.ModelElement.Store.TransactionManager.CurrentTransaction.IsSerializing)
                    {
                        return;
                    }
                }
            }

            if (e.ModelElement == null)
            {
                return;
            }

            if (ImmutabilityExtensionMethods.GetLocks(e.ModelElement) != Locks.None)
            {
                return;
            }

            DomainProperty domainProperty = e.ModelElement as DomainProperty;

            if (domainProperty != null)
            {
                DomainProperty          p       = domainProperty;
                AttributedDomainElement element = p.Element;

                if (element is DomainRelationship)
                {
                    // we have to set serialized in full form, unless it is embedded somewhere in the model
                    bool bIsEmbedded = false;
                    foreach (DomainRole role in element.RolesPlayed)
                    {
                        if (role.Relationship.Target == role && role.Relationship.InheritanceModifier != InheritanceModifier.Abstract && role.Relationship is EmbeddingRelationship)
                        {
                            bIsEmbedded = true;
                            continue;
                        }
                    }

                    if (!bIsEmbedded)
                    {
                        // we have to set is serialized in full form to true
                        if (element is EmbeddingRelationship)
                        {
                            (element as EmbeddingRelationship).SerializedEmbeddingRelationship.IsInFullSerialization = true;
                        }
                        else if (element is ReferenceRelationship)
                        {
                            (element as ReferenceRelationship).SerializedReferenceRelationship.IsInFullSerialization = true;
                        }
                    }
                }

                SerializationHelper.UpdateDerivedElementsSerializationProperties(element);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns the base class. Is called withing t4 templates.
 /// </summary>
 /// <param name="originatingClass"></param>
 /// <returns></returns>
 public AttributedDomainElement GetBaseClassSafely(AttributedDomainElement originatingClass)
 {
     if (System.Object.Equals(this.BaseElement, originatingClass))
     {
         return(null);
     }
     return(this.BaseElement);
 }
        /// <summary>
        /// Updaates serialized domain properties (add/remove) to reflect the existing domain properties onto the serialization model.
        /// </summary>
        /// <param name="store">Store containing the domain model.</param>
        /// <param name="serializationElement">Element to add or remove the serialized domain properties to.</param>
        /// <param name="domainElement">Element to get the domain properties from.</param>
        public static void UpdateSerializationDomainPropertiesOnCurrentLevel(Store store, AttributedDomainElement domainElement)
        {
            SerializationClass serializationClass;

            if (domainElement is DomainClass)            
                serializationClass = (domainElement as DomainClass).SerializedDomainClass;            
            else if (domainElement is ReferenceRelationship)
                serializationClass = (domainElement as ReferenceRelationship).SerializedReferenceRelationship;
            
            else if (domainElement is EmbeddingRelationship)
                serializationClass = (domainElement as EmbeddingRelationship).SerializedEmbeddingRelationship;
            else
                throw new NotSupportedException();

            if (serializationClass == null)
                throw new ArgumentNullException("serializationClass");

            // gather serialized properties (and create if required)
            List<SerializedDomainProperty> serializedAttributeProperty = new List<SerializedDomainProperty>();
            List<SerializedDomainProperty> serializedElementProperty = new List<SerializedDomainProperty>();
            foreach (DomainProperty domainProperty in domainElement.Properties)
            {
                if (domainProperty.SerializedDomainProperty == null)
                {
                    domainProperty.SerializedDomainProperty = CreateSerializedDomainProperty(domainProperty);
                    serializationClass.Properties.Add(domainProperty.SerializedDomainProperty);
                }

                if( domainProperty.SerializationRepresentationType == SerializationRepresentationType.Attribute )
                    serializedAttributeProperty.Add(domainProperty.SerializedDomainProperty);
                else
                    serializedElementProperty.Add(domainProperty.SerializedDomainProperty);
            }
            if (serializationClass.IdProperty == null)
            {
                serializationClass.IdProperty = CreateSerializedIdProperty(serializationClass.Store, domainElement);
                serializationClass.Attributes.Add(serializationClass.IdProperty);
            }

            // see what properties are missing or not required any more
            List<SerializedDomainProperty> serializedAttributePropertyToAdd = new List<SerializedDomainProperty>();
            List<SerializedDomainProperty> serializedElementPropertyToAdd = new List<SerializedDomainProperty>();

            foreach (SerializedDomainProperty p in serializedAttributeProperty)
                if (!serializationClass.Attributes.Contains(p))
                    serializedAttributePropertyToAdd.Add(p);

            foreach (SerializedDomainProperty p in serializedElementProperty)
                if (!serializationClass.Children.Contains(p))
                    serializedElementPropertyToAdd.Add(p);

            // add missing properties
            foreach (SerializedDomainProperty p in serializedAttributePropertyToAdd)
                serializationClass.Attributes.Add(p);

            foreach (SerializedDomainProperty p in serializedElementPropertyToAdd)
                serializationClass.Children.Add(p);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Adds a new embedding relationship instance. Needs to be called within a modeling transaction.
        /// </summary>
        /// <param name="source">Domain class representing the parent.</param>
        /// <param name="target">Domain class representing the child.</param>
        public static EmbeddingRelationship AddNewEmbeddingRS(DomainClass source, AttributedDomainElement target, bool bTargetElementHolder)
        {
            // create rs
            EmbeddingRelationship emb = new EmbeddingRelationship(source.Store);

            source.ModelContext.Relationships.Add(emb);

            // create roles
            DomainRole sourceRole = new DomainRole(source.Store);

            sourceRole.PropagatesDelete = false;

            DomainRole targetRole = new DomainRole(source.Store);

            targetRole.Multiplicity     = Multiplicity.One;
            targetRole.PropagatesDelete = true;

            sourceRole.RolePlayer = source;
            targetRole.RolePlayer = target;

            sourceRole.Opposite = targetRole;
            targetRole.Opposite = sourceRole;

            // assign roles to rs
            emb.Roles.Add(sourceRole);
            emb.Roles.Add(targetRole);

            emb.Source = sourceRole;
            emb.Target = targetRole;

            // properties + names
            if (emb.Source.RolePlayer.Name == emb.Target.RolePlayer.Name)
            {
                sourceRole.Name = source.Name + "Source";
            }
            else
            {
                sourceRole.Name = source.Name;
            }
            sourceRole.IsNameTracking = TrackingEnum.IgnoreOnce;

            if (emb.Source.RolePlayer.Name == emb.Target.RolePlayer.Name)
            {
                targetRole.Name = target.Name + "Target";
            }
            else
            {
                targetRole.Name = target.Name;
            }
            targetRole.IsNameTracking = TrackingEnum.IgnoreOnce;

            AddNewEmbeddingRS(emb, source, target, bTargetElementHolder);

            return(emb);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Updates current element roles as well as domain roles of all derived elements as well as roles of derived elements of derived elements
        /// </summary>
        /// <param name="element"></param>
        public static void UpdateDerivedElementsSerializationDomainRoles(AttributedDomainElement element)
        {
            if (element is DomainClass)
            {
                UpdateSerializationDomainRoles(element.Store, (element as DomainClass).SerializedDomainClass, element as DomainClass);

                LinkedElementCollection <DomainClass> classes = DomainClassReferencesBaseClass.GetDerivedClasses(element as DomainClass);
                foreach (DomainClass domainClass in classes)
                {
                    UpdateDerivedElementsSerializationDomainRoles(domainClass);
                }
            }
        }
        public override void ElementPropertyChanged(ElementPropertyChangedEventArgs e)
        {
            if (e.ModelElement != null)
            {
                if (e.ModelElement.Store.TransactionManager.CurrentTransaction != null)
                {
                    if (e.ModelElement.Store.TransactionManager.CurrentTransaction.IsSerializing)
                    {
                        return;
                    }
                }
            }

            if (e.ModelElement == null)
            {
                return;
            }

            if (ImmutabilityExtensionMethods.GetLocks(e.ModelElement) != Locks.None)
            {
                return;
            }

            AttributedDomainElement attributedDomainElement = e.ModelElement as AttributedDomainElement;

            if (attributedDomainElement != null)
            {
                if (e.DomainProperty.Id == AttributedDomainElement.NameDomainPropertyId)
                {
                    if (attributedDomainElement.IsSerializationNameTracking == TrackingEnum.True)
                    {
                        if (attributedDomainElement.SerializationName != attributedDomainElement.Name)
                        {
                            attributedDomainElement.SerializationName           = attributedDomainElement.Name;
                            attributedDomainElement.IsSerializationNameTracking = TrackingEnum.IgnoreOnce;
                        }
                    }
                }
                else if (e.DomainProperty.Id == AttributedDomainElement.SerializationNameDomainPropertyId)
                {
                    if (attributedDomainElement.IsSerializationNameTracking == TrackingEnum.IgnoreOnce)
                    {
                        attributedDomainElement.IsSerializationNameTracking = TrackingEnum.True;
                    }
                    else if (attributedDomainElement.IsSerializationNameTracking == TrackingEnum.True)
                    {
                        attributedDomainElement.IsSerializationNameTracking = TrackingEnum.False;
                    }
                }
            }
        }
 public static string GetSerializerBaseName(AttributedDomainElement domainClass)
 {
     if (domainClass.BaseElement != null)
     {
         string fullName = domainClass.BaseElement.GetMetaModel().Namespace;
         fullName = fullName + "." + domainClass.BaseElement.GetMetaModel().Name + domainClass.BaseElement.Name + "Serializer";
         return fullName;
     }
     else
     {
         if( domainClass is DomainClass )
             return "DslEditorModeling::SerializationDomainClassXmlSerializer";
         else
             return "DslEditorModeling::SerializationDomainRelationshipXmlSerializer";
     }
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Adds a new embedding relationship instance.
        /// </summary>
        /// <param name="source">Domain class representing the parent.</param>
        /// <param name="target">Domain class representing the child.</param>
        public static void AddNewEmbeddingRelationship(List <DomainClass> sources, AttributedDomainElement target)
        {
            if (sources.Count == 0)
            {
                return;
            }

            using (Transaction transaction = sources[0].Store.TransactionManager.BeginTransaction("Create new embedding rs"))
            {
                foreach (DomainClass source in sources)
                {
                    // create a new embedding relationship
                    AddNewEmbeddingRS(source, target, false);
                }
                transaction.Commit();
            }
        }
        public static bool HasProperty(AttributedDomainElement domainClass, string name)
        {
            if (domainClass == null)
                return false;

            AttributedDomainElement d = domainClass;
            while (d != null)
            {
                foreach (DomainProperty p in d.Properties)
                    if (p.Name == name)
                        return true;

                d = d.BaseElement;
            }

            return false;
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Adds a new referece relationship instance.
        /// </summary>
        /// <param name="source">Domain class representing the source.</param>
        /// <param name="target">Domain class representing the target.</param>
        public static void AddNewReferenceRelationship(List <DomainClass> sources, AttributedDomainElement target)
        {
            if (sources.Count == 0)
            {
                return;
            }

            using (Transaction transaction = sources[0].Store.TransactionManager.BeginTransaction("Create new reference rs"))
            {
                foreach (DomainClass source in sources)
                {
                    // create rs
                    AddNewReferenceRelationship(source, target);
                }

                transaction.Commit();
            }
        }
        private static SerializedIdProperty CreateSerializedIdProperty(Store store, AttributedDomainElement domainElement)
        {
            SerializedIdProperty idProperty = new SerializedIdProperty(store);
            idProperty.Name = "Id";
            idProperty.SerializationName = domainElement.ParentModelContext.SerializationModel.SerializedIdAttributeName;

            /*
            string idSerializationName = "Id";
            System.Collections.ObjectModel.ReadOnlyCollection<ModelElement> elements = store.ElementDirectory.FindElements(SerializedDomainModel.DomainClassId);
            foreach (ModelElement m in elements)
            {
                idSerializationName = (m as SerializedDomainModel).SerializedIdAttributeName;
                break;
            }
            idProperty.SerializationName = idSerializationName;
            */

            return idProperty;
        }
Ejemplo n.º 15
0
        private static SerializedIdProperty CreateSerializedIdProperty(Store store, AttributedDomainElement domainElement)
        {
            SerializedIdProperty idProperty = new SerializedIdProperty(store);

            idProperty.Name = "Id";
            idProperty.SerializationName = domainElement.ParentModelContext.SerializationModel.SerializedIdAttributeName;

            /*
             * string idSerializationName = "Id";
             * System.Collections.ObjectModel.ReadOnlyCollection<ModelElement> elements = store.ElementDirectory.FindElements(SerializedDomainModel.DomainClassId);
             * foreach (ModelElement m in elements)
             * {
             *  idSerializationName = (m as SerializedDomainModel).SerializedIdAttributeName;
             *  break;
             * }
             * idProperty.SerializationName = idSerializationName;
             */

            return(idProperty);
        }
        public static bool HasProperty(AttributedDomainElement domainClass, string name, SerializationRepresentationType rep)
        {
            if (domainClass == null)
                return false;

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

                d = d.BaseElement;
            }

            return false;
        }
        /// <summary>
        /// Updates current element roles as well as domain roles of all derived elements as well as roles of derived elements of derived elements
        /// </summary>
        /// <param name="element"></param>
        public static void UpdateDerivedElementsSerializationDomainRoles(AttributedDomainElement element)
        {
            if (element is DomainClass)
            {
                UpdateSerializationDomainRoles(element.Store, (element as DomainClass).SerializedDomainClass, element as DomainClass);

                LinkedElementCollection<DomainClass> classes = DomainClassReferencesBaseClass.GetDerivedClasses(element as DomainClass);
                foreach (DomainClass domainClass in classes)
                    UpdateDerivedElementsSerializationDomainRoles(domainClass);
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Adds a new referece relationship instance.
        /// </summary>
        /// <param name="source">Domain class representing the source.</param>
        /// <param name="target">Domain class representing the target.</param>
        public static ReferenceRelationship AddNewReferenceRelationship(DomainClass source, AttributedDomainElement target)
        {
            // create rs
            ReferenceRelationship refRel = new ReferenceRelationship(source.Store);

            source.ModelContext.Relationships.Add(refRel);

            // create roles
            DomainRole sourceRole = new DomainRole(source.Store);

            sourceRole.PropagatesDelete = false;

            DomainRole targetRole = new DomainRole(source.Store);

            targetRole.PropagatesDelete = false;

            sourceRole.RolePlayer = source;
            targetRole.RolePlayer = target;

            sourceRole.Opposite = targetRole;
            targetRole.Opposite = sourceRole;

            // assign roles to rs
            refRel.Roles.Add(sourceRole);
            refRel.Roles.Add(targetRole);

            refRel.Source = sourceRole;
            refRel.Target = targetRole;

            // properties + names
            if (refRel.Source.RolePlayer.Name == refRel.Target.RolePlayer.Name)
            {
                sourceRole.Name = source.Name + "Source";
            }
            else
            {
                sourceRole.Name = source.Name;
            }
            sourceRole.IsNameTracking = TrackingEnum.IgnoreOnce;

            if (refRel.Source.RolePlayer.Name == refRel.Target.RolePlayer.Name)
            {
                targetRole.Name = target.Name + "Target";
            }
            else
            {
                targetRole.Name = target.Name;
            }
            targetRole.IsNameTracking = TrackingEnum.IgnoreOnce;

            refRel.SerializationSourceName           = sourceRole.Name + "Ref";
            refRel.IsSerializationSourceNameTracking = TrackingEnum.IgnoreOnce;
            refRel.SerializationTargetName           = targetRole.Name + "Ref";
            refRel.IsSerializationTargetNameTracking = TrackingEnum.IgnoreOnce;

            AddNewReferenceRelationship(refRel, source, target);

            return(refRel);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Adds a new referece relationship instance.
        /// </summary>
        /// <param name="source">Domain class representing the source.</param>
        /// <param name="target">Domain class representing the target.</param>
        public static void AddNewReferenceRelationship(ReferenceRelationship refRel, DomainClass source, AttributedDomainElement target)
        {
            // tree nodes
            // 1. find the element holder node for source
            // 2. add new ReferenceRSNode, connect to rs
            // 3. add new ReferenceNode for target
            TreeNode elementHolderNode = null;

            foreach (TreeNode node in source.DomainModelTreeNodes)
            {
                if (node.IsElementHolder)
                {
                    elementHolderNode = node;
                    break;
                }
            }

            if (elementHolderNode == null)
            {
                throw new ArgumentNullException("elementHolderNode");
            }

            ReferenceRSNode rsNode = new ReferenceRSNode(source.Store);

            rsNode.ReferenceRelationship = refRel;

            ReferenceNode refNode = new ReferenceNode(source.Store);

            refNode.DomainElement   = target;
            refNode.IsElementHolder = false;
            refNode.IsExpanded      = false;

            elementHolderNode.ReferenceRSNodes.Add(rsNode);
            rsNode.ReferenceNode = refNode;

            source.ModelContext.ViewContext.DomainModelTreeView.ModelTreeNodes.Add(rsNode);
            source.ModelContext.ViewContext.DomainModelTreeView.ModelTreeNodes.Add(refNode);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Adds a new embedding relationship instance. Needs to be called within a modeling transaction.
        /// </summary>
        /// <param name="source">Domain class representing the parent.</param>
        /// <param name="target">Domain class representing the child.</param>
        public static void AddNewEmbeddingRS(EmbeddingRelationship emb, DomainClass source, AttributedDomainElement target, bool bTargetElementHolder)
        {
            // tree nodes
            // 1. find the element holder node for source
            // 2. add new EmbeddingRSNode, connect to rs
            // 3. add new EmbeddingNode for target
            TreeNode elementHolderNode = null;

            foreach (TreeNode node in source.DomainModelTreeNodes)
            {
                if (node.IsElementHolder)
                {
                    elementHolderNode = node;
                    break;
                }
            }

            if (elementHolderNode == null)
            {
                throw new ArgumentNullException("elementHolderNode");
            }

            EmbeddingRSNode rsNode = new EmbeddingRSNode(source.Store);

            rsNode.Relationship = emb;

            EmbeddingNode embNode = new EmbeddingNode(source.Store);

            embNode.DomainElement   = target;
            embNode.IsElementHolder = bTargetElementHolder;
            if (!bTargetElementHolder)
            {
                embNode.IsExpanded = false;
            }

            elementHolderNode.EmbeddingRSNodes.Add(rsNode);
            rsNode.EmbeddingNode = embNode;

            source.ModelContext.ViewContext.DomainModelTreeView.ModelTreeNodes.Add(rsNode);
            source.ModelContext.ViewContext.DomainModelTreeView.ModelTreeNodes.Add(embNode);
        }
        public static bool HasRelationship(AttributedDomainElement domainClass, string name)
        {
            if (domainClass == null)
                return false;

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

                d = d.BaseElement;
            }

            return false;
        }
public void HandlePropertyChangeEvents(PresentationElementClass shape, AttributedDomainElement domainElement)
{

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

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

	AttributedDomainElement temp = domainElement;
	while(temp != null )
	{
		foreach(DomainProperty property in temp.Properties)
		{

        
        #line default
        #line hidden
        
        #line 484 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("\tif( args.DomainProperty.Id == ");

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

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

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

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

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

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

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

		}
		
		temp = temp.BaseElement;
	}

	temp = shape;
	while(temp != null )
	{
		foreach(DomainProperty property in temp.Properties)
		{

        
        #line default
        #line hidden
        
        #line 498 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("\tif( args.DomainProperty.Id == ");

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

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

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

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

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

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

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

		}
		
		temp = temp.BaseElement;
	}
}
 public static string GetModelTreeViewModelFullName(AttributedDomainElement domainClass)
 {
     string fullName = domainClass.GetMetaModel().Namespace;
     fullName = fullName + ".ViewModel.ModelTree.ModelTree" + domainClass.Name + "ViewModel";
     return fullName;
 }
 public static string GetPropertyGridViewModelFullName(AttributedDomainElement domainClass)
 {
     string fullName = domainClass.GetMetaModel().Namespace;
     fullName = fullName + ".ViewModel.PropertyGrid.PropertyGrid" + domainClass.Name + "ViewModel";
     return fullName;
 }
Ejemplo n.º 25
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            if (e.ModelElement != null)
            {
                if (e.ModelElement.Store.TransactionManager.CurrentTransaction != null)
                {
                    if (e.ModelElement.Store.TransactionManager.CurrentTransaction.IsSerializing)
                    {
                        return;
                    }
                }
            }

            if (e.ModelElement == null)
            {
                return;
            }

            if (ImmutabilityExtensionMethods.GetLocks(e.ModelElement) != Locks.None)
            {
                return;
            }

            AttributedDomainElement attributedDomainElement = e.ModelElement as AttributedDomainElement;

            if (attributedDomainElement != null)
            {
                if (attributedDomainElement.IsDeleted || attributedDomainElement.IsDeleting)
                {
                    return;
                }

                if (attributedDomainElement is DomainRelationship)
                {
                    string name;
                    if (attributedDomainElement is EmbeddingRelationship)
                    {
                        name = EmbeddingRelationship.GenerateDomainRelationshipName((attributedDomainElement as DomainRelationship));
                    }
                    else
                    {
                        name = ReferenceRelationship.GenerateDomainRelationshipName((attributedDomainElement as DomainRelationship));
                    }


                    if (attributedDomainElement.Name == "")
                    {
                        attributedDomainElement.Name = name;
                        (attributedDomainElement as DomainRelationship).IsNameTracking = TrackingEnum.IgnoreOnce;
                    }
                }

                //if (attributedDomainElement.SerializationName != attributedDomainElement.Name)
                if (attributedDomainElement.SerializationName == "" || attributedDomainElement.SerializationName == null)
                {
                    attributedDomainElement.SerializationName           = attributedDomainElement.Name;
                    attributedDomainElement.IsSerializationNameTracking = TrackingEnum.IgnoreOnce;
                }

                attributedDomainElement.Namespace = attributedDomainElement.ParentModelContext.MetaModel.Namespace;
            }
        }
public void SubscribeToPropertyChangeEvents(AttributedDomainElement pElement)
{

        
        #line default
        #line hidden
        
        #line 12 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("\tif( this.Element != null )\r\n\t{\r\n\t\tthis.EventManager.GetEvent<DslEditorEvents::Mo" +
        "delElementPropertyChangedEvent>().Subscribe(this.Element.Id, new System.Action<D" +
        "slModeling::ElementPropertyChangedEventArgs>(OnElementPropertyChanged));\r\n\t}\r\n");

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

}
Ejemplo n.º 27
0
 /// <summary>
 /// Adds serialized domain properties to reflect the existing domain properties onto the serialization model.
 /// </summary>
 /// <param name="store">Store containing the domain model.</param>
 /// <param name="domainElement">Element to get the domain properties from.</param>
 public static void AddSerializationDomainProperties(Store store, AttributedDomainElement domainElement)
 {
     //if( domainElement.ParentModelContext.MetaModel.IsTopMost )
     UpdateSerializationDomainPropertiesOnCurrentLevel(store, domainElement);
 }
private void CreatePropertyAccessorsInternal(AttributedDomainElement domainElement, bool hasBaseClass)
{

        
        #line default
        #line hidden
        
        #line 184 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("#region Element Properties\r\n");

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

	AttributedDomainElement temp = domainElement;
	System.Collections.Generic.List<string> handledProperty = new System.Collections.Generic.List<string>();
	while(temp != null )
	{
		foreach(DomainProperty property in temp.Properties)
		{
			if( handledProperty.Contains(property.Name) )
				continue;
			
			handledProperty.Add(property.Name);
			
			AccessModifier setterAccessModifier = property.SetterAccessModifier;
			AccessModifier getterAccessModifier = property.GetterAccessModifier;
			AccessModifier overallAccessModifier;
			
			if(setterAccessModifier==AccessModifier.Public || getterAccessModifier==AccessModifier.Public)
			{
				overallAccessModifier = AccessModifier.Public;
			}
			else if(setterAccessModifier==AccessModifier.FamilyOrAssembly || getterAccessModifier==AccessModifier.FamilyOrAssembly)
			{
				overallAccessModifier = AccessModifier.FamilyOrAssembly;	
			}
			else if(setterAccessModifier==AccessModifier.Family || getterAccessModifier==AccessModifier.Family)
			{
				overallAccessModifier = AccessModifier.Family;
			}
			else if(setterAccessModifier==AccessModifier.Assembly || getterAccessModifier==AccessModifier.Assembly)
			{
				overallAccessModifier = AccessModifier.Assembly;
			}
			else 
			{
				overallAccessModifier = AccessModifier.Private;
			}			
			
			string modifier = "";
			if( hasBaseClass )
				modifier = " new";
			
			//if( p.IsElementName )

        
        #line default
        #line hidden
        
        #line 228 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("/// <summary>\r\n/// Gets or sets the value of ");

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

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

        
        #line default
        #line hidden
        
        #line 232 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(overallAccessModifier)));

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

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

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

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

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

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

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

	if(getterAccessModifier!=overallAccessModifier)
	{

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

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

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

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

	}
	else
	{

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

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

	}

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

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

	if( property.IsElementName )
	{

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

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

	}
	else
	{

        
        #line default
        #line hidden
        
        #line 258 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("\t\treturn (this.Element as ");

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

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

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

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

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

	}

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

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

		if(setterAccessModifier != overallAccessModifier)
		{

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

        
        #line default
        #line hidden
        
        #line 268 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(setterAccessModifier)));

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

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

		}
		else
		{

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

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

		}

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

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


	if( property.IsElementName )
	{

        
        #line default
        #line hidden
        
        #line 283 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("\t\tif( this.DomainElementName != value )\r\n\t\t\tthis.DomainElementName = value;\r\n");

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

	}
	else
	{

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

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

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

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

        
        #line default
        #line hidden
        
        #line 291 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write(" != value )\r\n\t\t{\r\n\t\t\tusing( DslModeling::Transaction transaction = this.Store.Tra" +
        "nsactionManager.BeginTransaction(\"Update value of ");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write(" = value;\r\n\t\t\t\t\r\n\t\t\t\ttransaction.Commit();\r\n\t\t\t}\r\n\t\t}\r\n");

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

	}

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

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

		}
		
		temp = temp.BaseElement;
	}

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

        
        #line default
        #line hidden
        
        #line 313 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
		
}
public string CreatePropertyAccessors(AttributedDomainElement domainElement, bool hasBaseClass)
{
	this.GenerationEnvironment = null;
	this.CreatePropertyAccessorsInternal(domainElement, hasBaseClass);
	return this.GenerationEnvironment.ToString();	
}
private void CreatePropertyHandlersInternal(AttributedDomainElement domainElement, bool hasBaseClass)
{
	CreatePropertyAccessorsInternal(domainElement, hasBaseClass);
	
	string modifier = "virtual";
	if( hasBaseClass )
		modifier = "override";
	

        
        #line default
        #line hidden
        
        #line 134 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("\r\n#region Subscription and Unsubscription\r\n/// <summary>\r\n/// Called whenever pro" +
        "perties change.\r\n/// </summary>\r\n/// <param name=\"args\"></param>\r\nprotected ");

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

        
        #line default
        #line hidden
        
        #line 141 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write(" void OnElementPropertyChanged(DslModeling::ElementPropertyChangedEventArgs args)" +
        "\r\n{\r\n");

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

	HandlePropertyChangeEvents(domainElement);

        
        #line default
        #line hidden
        
        #line 145 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("}\r\n\r\n/// <summary>\r\n/// Subscribes to model element property change events.\r\n/// " +
        "</summary>\r\nprotected override void Subscribe()\r\n{\r\n\tbase.Subscribe();\r\n\t\r\n");

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

	SubscribeToPropertyChangeEvents(domainElement);

        
        #line default
        #line hidden
        
        #line 157 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write("}\r\n\r\n/// <summary>\r\n/// Unsubscribes from model element property change events.\r\n" +
        "/// </summary>\r\nprotected override void Unsubscribe()\r\n{\r\n\tbase.Unsubscribe();\r\n" +
        "\t\r\n");

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

	UnsubscribeToPropertyChangeEvents(domainElement);

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

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

}
public string CreatePropertyHandlers(PresentationElementClass shape, AttributedDomainElement domainElement, bool hasBaseClass)
{
	this.GenerationEnvironment = null;
	this.CreatePropertyHandlersInternal(shape, domainElement, hasBaseClass);
	return this.GenerationEnvironment.ToString();
}
public void UnsubscribeToPropertyChangeEvents(PresentationElementClass shape, AttributedDomainElement pElement)
{

        
        #line default
        #line hidden
        
        #line 47 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
this.Write(@"	if( this.Element != null )
	{
		this.EventManager.GetEvent<DslEditorEvents::ModelElementPropertyChangedEvent>().Unsubscribe(this.Element.Id, new System.Action<DslModeling::ElementPropertyChangedEventArgs>(OnElementPropertyChanged));
	}
	
	if( this.ShapeElement != null )
	{
		this.EventManager.GetEvent<DslEditorEvents::ModelElementPropertyChangedEvent>().Unsubscribe(this.ShapeElement.Id, new System.Action<DslModeling::ElementPropertyChangedEventArgs>(OnElementPropertyChanged));
	}	
");

        
        #line default
        #line hidden
        
        #line 57 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\ViewModel\DiagramGeneratorHelper.tt"
	
}
private void AddDomainClassResources(AttributedDomainElement c, Dictionary<string, KeyValuePair<string, string>> resourcedStrings, string commentString, string propertyCommentString)
{
	string fullName = c.GetFullName(false);
	resourcedStrings.Add(fullName+".Description", new KeyValuePair<string, string>(c.Description, String.Format(CultureInfo.CurrentCulture, commentString, "Description", "DomainClass", c.Name)));
	resourcedStrings.Add(fullName+".DisplayName", new KeyValuePair<string, string>(c.DisplayName, String.Format(CultureInfo.CurrentCulture, commentString, "DisplayName", "DomainClass", c.Name)));
	
	foreach(DomainProperty p in c.Properties)
	{
		resourcedStrings.Add(fullName+"/"+p.Name+".Description", new KeyValuePair<string, string>(p.Description, String.Format(CultureInfo.CurrentCulture, propertyCommentString, "Description", "DomainProperty", p.Name, "DomainClass", c.Name)));
		resourcedStrings.Add(fullName+"/"+p.Name+".DisplayName", new KeyValuePair<string, string>(p.DisplayName, String.Format(CultureInfo.CurrentCulture, propertyCommentString, "DisplayName", "DomainProperty", p.Name, "DomainClass", c.Name)));
		if(!String.IsNullOrEmpty(p.Category))
		{
			resourcedStrings.Add(fullName+"/"+p.Name+".Category", new KeyValuePair<string, string>(p.Category, String.Format(CultureInfo.CurrentCulture, propertyCommentString, "Category", "DomainProperty", p.Name, "DomainClass", c.Name)));
		}
	}
}
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"

		}
}
 /// <summary>
 /// Adds serialized domain properties to reflect the existing domain properties onto the serialization model.
 /// </summary>
 /// <param name="store">Store containing the domain model.</param>
 /// <param name="domainElement">Element to get the domain properties from.</param>
 public static void AddSerializationDomainProperties(Store store, AttributedDomainElement domainElement)
 {
     //if( domainElement.ParentModelContext.MetaModel.IsTopMost )
         UpdateSerializationDomainPropertiesOnCurrentLevel(store, domainElement);
 }
	public void GenerateValidationFunction(AttributedDomainElement domainElement, string messageIdsClass)
	{

        
        #line default
        #line hidden
        
        #line 232 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\t\tpublic virtual void Validate");

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.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\DomainValidationGenerator.tt"
this.Write("(DslEditorModeling::ModelValidationContext context)\r\n\t\t{\r\n");

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

		foreach(DomainProperty p in domainElement.Properties)
		{
			if( p.IsRequired )
			{
				if( p.Type == null )
					continue;
				
				if( p.Type.Name.ToLower() == "string" )
				{

        
        #line default
        #line hidden
        
        #line 245 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\t\t\t// validate required attribute ");

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

        
        #line default
        #line hidden
        
        #line 246 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\r\n\t\t\tif( System.String.IsNullOrEmpty(this.");

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

        
        #line default
        #line hidden
        
        #line 247 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(") )\r\n\t\t\t{\r\n\t\t\t\tcontext.AddMessage(new DslEditorModeling::ModelValidationMessage(");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 249 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(", DslEditorModeling::ModelValidationViolationType.Error, \"Property \'");

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

        
        #line default
        #line hidden
        
        #line 249 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\' has no value although it is required\", this));\r\n\t\t\t}\r\n");

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

        
        #line default
        #line hidden
        
        #line 255 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\t\t\t// validate required attribute ");

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

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

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

        
        #line default
        #line hidden
        
        #line 257 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(" == null )\r\n\t\t\t{\r\n\t\t\t\tcontext.AddMessage(new DslEditorModeling::ModelValidationMe" +
        "ssage(");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 259 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(", DslEditorModeling::ModelValidationViolationType.Error, \"Property \'");

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

        
        #line default
        #line hidden
        
        #line 259 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\' has no value although it is required\", this));\r\n\t\t\t}\r\n");

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

				}
			}
		}
		int counter = 0;
		foreach(DomainRole role in domainElement.RolesPlayed )
		{		
			// validate reference relationships --> cardinality constraints
			//if( role.Relationship.Source == role && role.Relationship is ReferenceRelationship )
			if( role.Relationship is ReferenceRelationship )
			{
				ReferenceRelationship con = role.Relationship as ReferenceRelationship;
				if( role != role.Relationship.Source && !(con.Target.RolePlayer is DomainClass) )
					continue;
				
				if( role.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.ZeroMany)
					continue;

        
        #line default
        #line hidden
        
        #line 278 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\r\n\t\t\t// validate reference relationship from ");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 280 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(")\r\n\t\t\tSystem.Collections.ObjectModel.ReadOnlyCollection<");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 281 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(" =  DslModeling::DomainRoleInfo.GetElementLinks<");

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

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

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

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

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

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

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

				if( role.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.One || role.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.OneMany )
				{

        
        #line default
        #line hidden
        
        #line 285 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\t\t\t// validate reference relationships --> see if cardinality constraints are met" +
        "\r\n\t\t\tif( allM");

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

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

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

        
        #line default
        #line hidden
        
        #line 287 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(".Count == 0 )\r\n\t\t\t{\r\n\t\t\t\tcontext.AddMessage(new DslEditorModeling::ModelValidatio" +
        "nMessage(");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 289 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(", DslEditorModeling::ModelValidationViolationType.Error, \"Reference to element of" +
        " type ");

        
        #line default
        #line hidden
        
        #line 289 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Opposite.RolePlayer.DisplayName));

        
        #line default
        #line hidden
        
        #line 289 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(" is missing, although it is required. Role name: + ");

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

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

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

				}
				else if( role.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.ZeroOne )
				{

        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\t\t\t// validate reference relationships --> see if cardinality constraints are met" +
        "\r\n\t\t\tif( allM");

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

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

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

        
        #line default
        #line hidden
        
        #line 297 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(".Count > 1 )\r\n\t\t\t{\r\n\t\t\t\tcontext.AddMessage(new DslEditorModeling::ModelValidation" +
        "Message(");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 299 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(", DslEditorModeling::ModelValidationViolationType.Error, \"There are multiple refe" +
        "rences to elements of type ");

        
        #line default
        #line hidden
        
        #line 299 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Opposite.RolePlayer.DisplayName));

        
        #line default
        #line hidden
        
        #line 299 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(", although only one is allowed. Role name: + ");

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

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

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

				
				}
				counter++;
			}			
			
			if( role.Relationship.Source == role && role.Relationship is EmbeddingRelationship)
			{
				EmbeddingRelationship con = role.Relationship as EmbeddingRelationship;
				if( con.Source.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.ZeroMany )
					continue;

        
        #line default
        #line hidden
        
        #line 312 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\r\n\t\t\t// validate embedding relationship from ");

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

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

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

        
        #line default
        #line hidden
        
        #line 314 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\r\n\t\t\tSystem.Collections.ObjectModel.ReadOnlyCollection<");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 315 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(" =  DslModeling::DomainRoleInfo.GetElementLinks<");

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

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

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

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

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

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

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

			if( con.Source.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.One || con.Source.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.OneMany )
			{

        
        #line default
        #line hidden
        
        #line 319 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\t\t\t// validate embedding relationships --> see if cardinality constraints are met" +
        "\r\n\t\t\tif( allM");

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

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

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

        
        #line default
        #line hidden
        
        #line 321 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(".Count == 0 )\r\n\t\t\t{\r\n\t\t\t\tcontext.AddMessage(new DslEditorModeling::ModelValidatio" +
        "nMessage(");

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

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

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

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

        
        #line default
        #line hidden
        
        #line 323 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

        
        #line default
        #line hidden
        
        #line 323 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(", DslEditorModeling::ModelValidationViolationType.Error, \"Embedded element of typ" +
        "e ");

        
        #line default
        #line hidden
        
        #line 323 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

        
        #line default
        #line hidden
        
        #line 323 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(" is missing, although it is required.\", this));\r\n\t\t\t}\r\n");

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

			}
			else if( con.Source.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.ZeroOne )
			{

        
        #line default
        #line hidden
        
        #line 329 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write("\t\t\t// validate embedding relationships --> see if cardinality constraints are met" +
        "\r\n\t\t\tif( allM");

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

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

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

        
        #line default
        #line hidden
        
        #line 331 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(".Count > 1 )\r\n\t\t\t{\r\n\t\t\t\tcontext.AddMessage(new DslEditorModeling::ModelValidation" +
        "Message(");

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

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

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

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

        
        #line default
        #line hidden
        
        #line 333 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

        
        #line default
        #line hidden
        
        #line 333 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(", DslEditorModeling::ModelValidationViolationType.Error, \"Multiple Embedded eleme" +
        "nts of type ");

        
        #line default
        #line hidden
        
        #line 333 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

        
        #line default
        #line hidden
        
        #line 333 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainValidationGenerator.tt"
this.Write(" found, although only one is allowed.\", this));\r\n\t\t\t}\r\n");

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

				
			}
			
				counter++;
			}
		}

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

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

}
Ejemplo n.º 37
0
        /// <summary>
        /// Updaates serialized domain properties (add/remove) to reflect the existing domain properties onto the serialization model.
        /// </summary>
        /// <param name="store">Store containing the domain model.</param>
        /// <param name="serializationElement">Element to add or remove the serialized domain properties to.</param>
        /// <param name="domainElement">Element to get the domain properties from.</param>
        public static void UpdateSerializationDomainProperties(Store store, SerializationClass serializationClass, AttributedDomainElement domainElement)
        {
            if (serializationClass == null || domainElement == null)
            {
                return;
            }

            //if (!domainElement.ParentModelContext.MetaModel.IsTopMost)
            //    return;

            // update serialization properties on the current level: --> add missing
            UpdateSerializationDomainPropertiesOnCurrentLevel(store, domainElement);

            List <SerializedDomainProperty> serializedAttributePropertyToAdd = new List <SerializedDomainProperty>();
            List <SerializedDomainProperty> serializedElementPropertyToAdd   = new List <SerializedDomainProperty>();

            AttributedDomainElement element = domainElement;

            while (element != null)
            {
                foreach (DomainProperty domainProperty in element.Properties)
                {
                    if (domainProperty.SerializedDomainProperty != null)
                    {
                        if (domainProperty.SerializedDomainProperty.SerializationRepresentationType == SerializationRepresentationType.Attribute)
                        {
                            serializedAttributePropertyToAdd.Add(domainProperty.SerializedDomainProperty);
                        }
                        else if (domainProperty.SerializedDomainProperty.SerializationRepresentationType == SerializationRepresentationType.Element)
                        {
                            serializedElementPropertyToAdd.Add(domainProperty.SerializedDomainProperty);
                        }
                    }
                }
                element = element.BaseElement;
            }

            // 1. add missing
            foreach (SerializedDomainProperty p in serializedAttributePropertyToAdd)
            {
                if (!serializationClass.Attributes.Contains(p))
                {
                    serializationClass.Attributes.Add(p);
                }
            }

            foreach (SerializedDomainProperty p in serializedElementPropertyToAdd)
            {
                if (!serializationClass.Children.Contains(p))
                {
                    serializationClass.Children.Add(p);
                }
            }

            // 2. remove unneeded ones
            for (int i = serializationClass.Attributes.Count - 1; i >= 0; i--)
            {
                if (serializationClass.Attributes[i] is SerializedDomainProperty)
                {
                    if (!serializedAttributePropertyToAdd.Contains(serializationClass.Attributes[i] as SerializedDomainProperty))
                    {
                        serializationClass.Attributes.RemoveAt(i);
                    }
                }
            }

            for (int i = serializationClass.Children.Count - 1; i >= 0; i--)
            {
                if (serializationClass.Children[i] is SerializedDomainProperty)
                {
                    if (!serializedElementPropertyToAdd.Contains(serializationClass.Children[i] as SerializedDomainProperty))
                    {
                        serializationClass.Children.RemoveAt(i);
                    }
                }
            }
        }
 public static string GetDependencyItemsProviderFullName(AttributedDomainElement domainClass)
 {
     string fullName = domainClass.GetMetaModel().Namespace;
     fullName = fullName + "." + domainClass.Name + "DependencyItemsProvider";
     return fullName;
 }
        /// <summary>
        /// Updates current element properties as well as the properties of all derived elements as well as properties of derived elements of derived elements
        /// </summary>
        /// <param name="element"></param>
        public static void UpdateDerivedElementsSerializationProperties(AttributedDomainElement element)
        {
            if (element is DomainClass)
            {
                UpdateSerializationDomainProperties(element.Store, (element as DomainClass).SerializedDomainClass, element);

                LinkedElementCollection<DomainClass> classes = DomainClassReferencesBaseClass.GetDerivedClasses(element as DomainClass);
                foreach (DomainClass domainClass in classes)
                    UpdateDerivedElementsSerializationProperties(domainClass);
            }
            else if (element is DomainRelationship)
            {
                if (element is ReferenceRelationship)
                    UpdateSerializationDomainProperties(element.Store, (element as ReferenceRelationship).SerializedReferenceRelationship, element);

                if (element is EmbeddingRelationship)
                    UpdateSerializationDomainProperties(element.Store, (element as EmbeddingRelationship).SerializedEmbeddingRelationship, element);

                LinkedElementCollection<DomainRelationship> classes = DomainRelationshipReferencesBaseRelationship.GetDerivedRelationships(element as DomainRelationship);
                foreach (DomainRelationship d in classes)
                    UpdateDerivedElementsSerializationProperties(d);
            }
        }
 /// <summary>
 /// Returns the base class. Is called withing t4 templates.
 /// </summary>
 /// <param name="originatingClass"></param>
 /// <returns></returns>
 public AttributedDomainElement GetBaseClassSafely(AttributedDomainElement originatingClass)
 {
     if (System.Object.Equals(this.BaseElement, originatingClass))
         return null;
     return this.BaseElement;
 }
Ejemplo n.º 41
0
        /// <summary>
        /// Updaates serialized domain properties (add/remove) to reflect the existing domain properties onto the serialization model.
        /// </summary>
        /// <param name="store">Store containing the domain model.</param>
        /// <param name="serializationElement">Element to add or remove the serialized domain properties to.</param>
        /// <param name="domainElement">Element to get the domain properties from.</param>
        public static void UpdateSerializationDomainPropertiesOnCurrentLevel(Store store, AttributedDomainElement domainElement)
        {
            SerializationClass serializationClass;

            if (domainElement is DomainClass)
            {
                serializationClass = (domainElement as DomainClass).SerializedDomainClass;
            }
            else if (domainElement is ReferenceRelationship)
            {
                serializationClass = (domainElement as ReferenceRelationship).SerializedReferenceRelationship;
            }

            else if (domainElement is EmbeddingRelationship)
            {
                serializationClass = (domainElement as EmbeddingRelationship).SerializedEmbeddingRelationship;
            }
            else
            {
                throw new NotSupportedException();
            }

            if (serializationClass == null)
            {
                throw new ArgumentNullException("serializationClass");
            }

            // gather serialized properties (and create if required)
            List <SerializedDomainProperty> serializedAttributeProperty = new List <SerializedDomainProperty>();
            List <SerializedDomainProperty> serializedElementProperty   = new List <SerializedDomainProperty>();

            foreach (DomainProperty domainProperty in domainElement.Properties)
            {
                if (domainProperty.SerializedDomainProperty == null)
                {
                    domainProperty.SerializedDomainProperty = CreateSerializedDomainProperty(domainProperty);
                    serializationClass.Properties.Add(domainProperty.SerializedDomainProperty);
                }

                if (domainProperty.SerializationRepresentationType == SerializationRepresentationType.Attribute)
                {
                    serializedAttributeProperty.Add(domainProperty.SerializedDomainProperty);
                }
                else
                {
                    serializedElementProperty.Add(domainProperty.SerializedDomainProperty);
                }
            }
            if (serializationClass.IdProperty == null)
            {
                serializationClass.IdProperty = CreateSerializedIdProperty(serializationClass.Store, domainElement);
                serializationClass.Attributes.Add(serializationClass.IdProperty);
            }

            // see what properties are missing or not required any more
            List <SerializedDomainProperty> serializedAttributePropertyToAdd = new List <SerializedDomainProperty>();
            List <SerializedDomainProperty> serializedElementPropertyToAdd   = new List <SerializedDomainProperty>();

            foreach (SerializedDomainProperty p in serializedAttributeProperty)
            {
                if (!serializationClass.Attributes.Contains(p))
                {
                    serializedAttributePropertyToAdd.Add(p);
                }
            }

            foreach (SerializedDomainProperty p in serializedElementProperty)
            {
                if (!serializationClass.Children.Contains(p))
                {
                    serializedElementPropertyToAdd.Add(p);
                }
            }

            // add missing properties
            foreach (SerializedDomainProperty p in serializedAttributePropertyToAdd)
            {
                serializationClass.Attributes.Add(p);
            }

            foreach (SerializedDomainProperty p in serializedElementPropertyToAdd)
            {
                serializationClass.Children.Add(p);
            }
        }
public string GenerateDomainClassSerializer(AttributedDomainElement domainClass, string namespaceString)
{
	this.GenerationEnvironment = null;
	this.MetaModel = domainClass.GetMetaModel();
	if( this.GenerateDomainClassSerializerInternal(domainClass, namespaceString) == null )
		return null;
	return this.GenerationEnvironment.ToString();	
}
        /// <summary>
        /// Updaates serialized domain properties (add/remove) to reflect the existing domain properties onto the serialization model.
        /// </summary>
        /// <param name="store">Store containing the domain model.</param>
        /// <param name="serializationElement">Element to add or remove the serialized domain properties to.</param>
        /// <param name="domainElement">Element to get the domain properties from.</param>
        public static void UpdateSerializationDomainProperties(Store store, SerializationClass serializationClass, AttributedDomainElement domainElement)
        {
            if (serializationClass == null || domainElement == null)
                return;

            //if (!domainElement.ParentModelContext.MetaModel.IsTopMost)
            //    return;

            // update serialization properties on the current level: --> add missing
            UpdateSerializationDomainPropertiesOnCurrentLevel(store, domainElement);

            List<SerializedDomainProperty> serializedAttributePropertyToAdd = new List<SerializedDomainProperty>();
            List<SerializedDomainProperty> serializedElementPropertyToAdd = new List<SerializedDomainProperty>();

            AttributedDomainElement element = domainElement;
            while (element != null)
            {
                foreach (DomainProperty domainProperty in element.Properties)
                {
                    if (domainProperty.SerializedDomainProperty != null)
                    {
                        if (domainProperty.SerializedDomainProperty.SerializationRepresentationType == SerializationRepresentationType.Attribute)
                            serializedAttributePropertyToAdd.Add(domainProperty.SerializedDomainProperty);
                        else if( domainProperty.SerializedDomainProperty.SerializationRepresentationType == SerializationRepresentationType.Element )
                            serializedElementPropertyToAdd.Add(domainProperty.SerializedDomainProperty);
                    }
                }
                element = element.BaseElement;
            }

            // 1. add missing
            foreach (SerializedDomainProperty p in serializedAttributePropertyToAdd)
                if(!serializationClass.Attributes.Contains(p))
                    serializationClass.Attributes.Add(p);

            foreach (SerializedDomainProperty p in serializedElementPropertyToAdd)
                if (!serializationClass.Children.Contains(p))
                    serializationClass.Children.Add(p);

            // 2. remove unneeded ones
            for(int i = serializationClass.Attributes.Count-1; i>=0; i-- )
                if( serializationClass.Attributes[i] is SerializedDomainProperty)
                    if(!serializedAttributePropertyToAdd.Contains(serializationClass.Attributes[i] as SerializedDomainProperty))
                        serializationClass.Attributes.RemoveAt(i);

            for (int i = serializationClass.Children.Count - 1; i >= 0; i--)
                if (serializationClass.Children[i] is SerializedDomainProperty)
                    if (!serializedElementPropertyToAdd.Contains(serializationClass.Children[i] as SerializedDomainProperty))
                        serializationClass.Children.RemoveAt(i);
        }
private string GenerateDomainClassSerializerInternal(AttributedDomainElement domainClass, string namespaceString)
{
	string classTypeString = domainClass.GetFullName (true);
	bool isRelationship = (domainClass is DomainRelationship);
	bool isAbstract = (domainClass.InheritanceModifier == InheritanceModifier.Abstract);
	bool isSealed = (domainClass.InheritanceModifier == InheritanceModifier.Sealed);
	
	string serializerGenerationClassName = this.MetaModel.Name + domainClass.Name + "Serializer";
	if( domainClass.GeneratesDoubleDerived )
		serializerGenerationClassName = this.MetaModel.Name + domainClass.Name + "BaseSerializer";
	string serializerClassName = this.MetaModel.Name + domainClass.Name + "Serializer";
	string baseSerializerClassName = CodeGenerationUtilities.GetSerializerBaseName(domainClass);

	bool bContinue = true;
	if( isRelationship )
	{
		if( !(domainClass as DomainRelationship).NeedsFullSerialization() )
		{
			if( domainClass is ReferenceRelationship )
				if( !(domainClass as ReferenceRelationship).SerializedReferenceRelationship.IsInFullSerialization )
					bContinue = false;
				
			if( domainClass is EmbeddingRelationship )
				if( !(domainClass as EmbeddingRelationship).SerializedEmbeddingRelationship.IsInFullSerialization )
					bContinue = false;				
		}
	}
	
	if( !bContinue )
		return null;
	
	// calculate properties
	DomainProperty propertySerializedAsInnerValue = null;
	foreach(DomainProperty p in domainClass.Properties)
	{
		if(p.SerializationRepresentationType == SerializationRepresentationType.InnerValue )
		{
			propertySerializedAsInnerValue = p;
			continue;
		}
	}
			
	bool bOmitIdProperty = false;
	LinkedElementCollection<SerializationElement> Children = null;
	LinkedElementCollection<SerializationAttributeElement> Attributes = null;
	if( domainClass is DomainClass )
	{
		SerializedDomainClass d = (domainClass as DomainClass).SerializedDomainClass;
		if( d.IdProperty.OmitIdProperty )
			bOmitIdProperty = true;
		Children = d.Children;
		Attributes = d.Attributes;		
	}
	
	if( domainClass is ReferenceRelationship )
	{
		SerializedReferenceRelationship d = (domainClass as ReferenceRelationship).SerializedReferenceRelationship;
		if( d.IdProperty.OmitIdProperty )
			bOmitIdProperty = true;
		Children = d.Children;
		Attributes = d.Attributes;		
	}
	
	if( domainClass is EmbeddingRelationship )
	{
		SerializedEmbeddingRelationship d = (domainClass as EmbeddingRelationship).SerializedEmbeddingRelationship;
		if( d.IdProperty.OmitIdProperty )
			bOmitIdProperty = true;
		Children = d.Children;
		Attributes = d.Attributes;
	}

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

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

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

        
        #line default
        #line hidden
        
        #line 94 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
	
	PushIndent("\t");
	int inheritanceDepth = CodeGenerationUtilities.CalculateInheritanceDepth (domainClass);

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

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

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

        
        #line default
        #line hidden
        
        #line 99 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetRelativeName(namespaceString, false)));

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

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

	if (domainClass.GeneratesDoubleDerived)
	{
		if (inheritanceDepth > 6)
		{

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

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

		}
	}
	else if (inheritanceDepth > 5)
	{

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

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

	}

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

        
        #line default
        #line hidden
        
        #line 118 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GeneratesDoubleDerived ? " abstract" : (domainClass.InheritanceModifier == InheritanceModifier.Sealed ? " sealed" : string.Empty)));

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

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

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 124 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GeneratesDoubleDerived ? "protected" : "public"));

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

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

        
        #line default
        #line hidden
        
        #line 124 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" ()\r\n\t\t: base ()\r\n\t{\r\n\t}\r\n\t#endregion\r\n\t\r\n\t#region Public Properties\r\n");

        
        #line default
        #line hidden
        
        #line 131 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
 
	if( !isAbstract )
	{

        
        #line default
        #line hidden
        
        #line 134 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\r\n\t/// <summary>\r\n\t/// This is the XML tag name used to serialize an instance of" +
        " ");

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

        
        #line default
        #line hidden
        
        #line 136 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".\r\n\t/// </summary>\r\n\tpublic override string XmlTagName\r\n\t{\r\n\t\tget{\r\n\t\t\treturn \"");

        
        #line default
        #line hidden
        
        #line 141 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.SerializationName));

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

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

	}
	else
	{

        
        #line default
        #line hidden
        
        #line 148 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\r\n\t/// <summary>\r\n\t/// Cannot be serialized.\r\n\t/// </summary>\r\n\tpublic override " +
        "string XmlTagName\r\n\t{\r\n\t\t[global::System.Diagnostics.DebuggerStepThrough]\r\n\t\tget" +
        " { return string.Empty; }\r\n\t}\r\n");

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

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

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

	

        
        #line default
        #line hidden
        
        #line 163 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n\t#region Read\r\n\t/// <summary>\r\n\t/// Public Read() method that deserializes one " +
        "");

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

        
        #line default
        #line hidden
        
        #line 167 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance from XML.\r\n\t/// </summary>\r\n\t/// <remarks>\r\n\t/// When this method is ca" +
        "lled, caller guarantees that the passed-in XML reader is positioned at the open " +
        "XML tag\r\n\t/// of the ");

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

        
        #line default
        #line hidden
        
        #line 171 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" element that is about to be deserialized. 
	/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
	/// or the close tag of the parent element (or EOF).
	/// </remarks>
	/// <param name=""serializationContext"">Serialization context.</param>
	/// <param name=""element"">In-memory ");

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

        
        #line default
        #line hidden
        
        #line 176 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance that will get the deserialized data.</param>
	/// <param name=""reader"">XmlReader to read serialized data from.</param>
	public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
	{
");

        
        #line default
        #line hidden
        
        #line 180 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
 
	if( isAbstract )
	{

        
        #line default
        #line hidden
        
        #line 183 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tthrow new global::System.NotSupportedException();\r\n");

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

	}
	else
	{

        
        #line default
        #line hidden
        
        #line 189 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"		#region Check Parameters
		global::System.Diagnostics.Debug.Assert (serializationContext != null);
		if (serializationContext == null)
			throw new global::System.ArgumentNullException (""serializationContext"");
		global::System.Diagnostics.Debug.Assert (element != null);
		if (element == null)
			throw new global::System.ArgumentNullException (""element"");
		global::System.Diagnostics.Debug.Assert (reader != null);
		if (reader == null)
			throw new global::System.ArgumentNullException (""reader"");
		#endregion

  		// Read properties serialized as XML attributes.
		ReadPropertiesFromAttributes(serializationContext, element, reader);
		
		// Read nested XML elements.
		if (!serializationContext.Result.Failed)
		{
			if (!reader.IsEmptyElement)
			{
");

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

			if( propertySerializedAsInnerValue != null )
			{
				string isReq = "false";
				if( propertySerializedAsInnerValue.IsRequired )
					isReq = "true";

        
        #line default
        #line hidden
        
        #line 216 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\t// Read inner value property\r\n\t\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 218 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance = element as ");

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

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

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

				if( propertySerializedAsInnerValue.Type.SerializationStyle == SerializationStyle.CDATA )					
				{

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

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

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

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

        
        #line default
        #line hidden
        
        #line 223 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ReadCDATAFromInnerXmlAsString(serializationContext, " +
        "instance, reader);\r\n");

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

				}
				else
				{

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

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

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

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

        
        #line default
        #line hidden
        
        #line 229 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ReadInnerXmlAsString(serializationContext, instance," +
        " reader);\r\n");

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

				}

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

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(propertySerializedAsInnerValue)));

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

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

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

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

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertTypedObjectFrom(serializationContext, instanc" +
        "e, \"");

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

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

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

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

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(propertySerializedAsInnerValue)));

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

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

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

        
        #line default
        #line hidden
        
        #line 233 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(propertySerializedAsInnerValue)));

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

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

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

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

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

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

			}

        
        #line default
        #line hidden
        
        #line 238 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"				// Read to the start of the first child element.
				DslModeling::SerializationUtilities.SkipToFirstChild(reader);
								
				// Read nested XML elements, they can be either properties serialized as XML elements, or child 
				// model elements.
				while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
				{
					ReadElements(serializationContext, element, reader);
			
					if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
					{
						// Encountered one unknown XML element, skip it and keep reading.
						");

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

        
        #line default
        #line hidden
        
        #line 251 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationCont" +
        "ext, reader, \"");

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

        
        #line default
        #line hidden
        
        #line 251 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\");\r\n\t\t\t\t\t\tDslModeling::SerializationUtilities.Skip(reader);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}" +
        "\r\n\t\t}\r\n\t\r\n\t\t// Advance the reader to the next element (open tag of the next sibl" +
        "ing, end tag of the parent, or EOF)\r\n\t\tDslModeling::SerializationUtilities.Skip(" +
        "reader);\r\n");

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

	}

        
        #line default
        #line hidden
        
        #line 262 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"	
	}
	
	/// <summary>
	/// This method deserializes all properties that are serialized as XML attributes.
	/// </summary>
	/// <remarks>
	/// Because this method only handles properties serialized as XML attributes, the passed-in reader shouldn't be moved inside this method.
	/// The caller will guarantee that the reader is positioned on the open XML tag of the current element being deserialized.
	/// </remarks>
	/// <param name=""serializationContext"">Serialization context.</param>
	/// <param name=""element"">In-memory ");

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

        
        #line default
        #line hidden
        
        #line 273 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance that will get the deserialized data.</param>
	/// <param name=""reader"">XmlReader to read serialized data from.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected override void ReadPropertiesFromAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
	{
		");

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

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

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

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

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

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

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

		List<SerializedDomainProperty> propertiesToReadInThisClass = new List<SerializedDomainProperty>();
		if( Attributes != null )
		{
			foreach(SerializationAttributeElement attr in Attributes )
			{
				if( !(attr is SerializedDomainProperty ) )
					continue;
				
				SerializedDomainProperty sP = attr as SerializedDomainProperty;
				DomainProperty p = sP.DomainProperty;	
				

				if( p.Element.GetMetaModel() == this.MetaModel && p.Element == domainClass)
					propertiesToReadInThisClass.Add(sP);


        
        #line default
        #line hidden
        
        #line 295 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tif (!serializationContext.Result.Failed)\r\n\t\t{\r\n\t\t\tReadPropertyAsAttribute");

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

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

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

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

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

				

			}
		}

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

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

			foreach(SerializedDomainProperty sP in propertiesToReadInThisClass)
			{
				DomainProperty p = sP.DomainProperty;
				
				string isReq = "false";
				if( p.IsRequired )
					isReq = "true";
				
				if( sP.SerializationRepresentationType != SerializationRepresentationType.Attribute )
					continue;
				
				string modifier ="";
				if( CodeGenerationUtilities.HasProperty(domainClass.BaseElement, p.Name))
					modifier = "new ";

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

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

        
        #line default
        #line hidden
        
        #line 325 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that needed to be serialized as XML attribute.\r\n\t/// </summary>\r\n\t/// <param nam" +
        "e=\"serializationContext\">Serialization context.</param>\r\n\t/// <param name=\"insta" +
        "nce\">");

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

        
        #line default
        #line hidden
        
        #line 328 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance to be serialized.</param>\r\n\t/// <param name=\"reader\">XmlReader.</param>" +
        " \r\n\t[global::System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Maintain" +
        "ability\", \"CA1502:AvoidExcessiveComplexity\", Justification = \"Generated code.\")]" +
        "\r\n\tprotected ");

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

        
        #line default
        #line hidden
        
        #line 331 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("virtual void ReadPropertyAsAttribute");

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

        
        #line default
        #line hidden
        
        #line 331 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 331 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlReader reader)\r\n\t{\r\n");

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

				if( sP.SerializationName == "" )
				{

        
        #line default
        #line hidden
        
        #line 336 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tError because the SerializationName of SerializedDomainProperty (");

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

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

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

				}
				else
				{

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

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

        
        #line default
        #line hidden
        
        #line 343 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n\t\tif (!serializationContext.Result.Failed)\r\n\t\t{\r\n\t\t\tstring attribValue = ");

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

        
        #line default
        #line hidden
        
        #line 346 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ReadAttribute(serializationContext, instance, reader" +
        ", \"");

        
        #line default
        #line hidden
        
        #line 346 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

        
        #line default
        #line hidden
        
        #line 346 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\");\r\n\t\t\tif( attribValue != null )\r\n\t\t\t\tinstance.");

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

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

        
        #line default
        #line hidden
        
        #line 348 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Type.MetaModel.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 348 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertTypedObjectFrom(serializationContext, instanc" +
        "e, \"");

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

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

        
        #line default
        #line hidden
        
        #line 348 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(p)));

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

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

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

        
        #line default
        #line hidden
        
        #line 348 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(p)));

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

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

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

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

			}

        
        #line default
        #line hidden
        
        #line 356 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"	
	
	/// <summary>
	/// This methods deserializes nested XML elements inside the passed-in element.
	/// </summary>
	/// <remarks>
	/// The caller will guarantee that the current element does have nested XML elements, and the call will position the 
	/// reader at the open tag of the first child XML element.
	/// This method will read as many child XML elements as it can. It returns under three circumstances:
	/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the open 
	///    tag of the unknown element. This implies that if the first child XML element is unknown, this method should return 
	///    immediately and do nothing.
	/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
	/// 3) EOF.
	/// </remarks>
	/// <param name=""serializationContext"">Serialization context.</param>
	/// <param name=""element"">In-memory ");

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

        
        #line default
        #line hidden
        
        #line 372 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance that will get the deserialized data.</param>
	/// <param name=""reader"">XmlReader to read serialized data from.</param>
	protected override void ReadElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
	{
");

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

	if( Children != null)
		if( Children.Count >  0 )
		{

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

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

        
        #line default
        #line hidden
        
        #line 381 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance = element as ");

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

        
        #line default
        #line hidden
        
        #line 381 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\tglobal::System.Diagnostics.Debug.Assert(instance != null, \"Expecting an inst" +
        "ance of ");

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

        
        #line default
        #line hidden
        
        #line 382 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("!\");\r\n\r\n\t\twhile (!serializationContext.Result.Failed && !reader.EOF && reader.Nod" +
        "eType == global::System.Xml.XmlNodeType.Element)\r\n\t\t{\r\n\t\t\tif(! ReadElement(seria" +
        "lizationContext, instance, reader, reader.LocalName) )\r\n\t\t\t\treturn;\r\n\t\t}\r\n");

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

		}

        
        #line default
        #line hidden
        
        #line 391 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t}\r\n\t\r\n\t/// <summary>\r\n\t/// This methods deserializes nested XML elements inside " +
        "the passed-in element.\r\n\t/// </summary>\r\n\t/// <param name=\"serializationContext\"" +
        ">Serialization context.</param>\r\n\t/// <param name=\"instance\">In-memory ");

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

        
        #line default
        #line hidden
        
        #line 398 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance that will get the deserialized data.</param>
	/// <param name=""reader"">XmlReader to read serialized data from.</param>
	/// <param name=""readerLocalName"">Current local name the xml reader is positioned at.</param>	
	/// <returns>True if the element has been successfully deserialized. False otherwise.</returns>
	protected virtual bool ReadElement(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 402 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlReader reader, string readerLocalName)\r\n\t{\r\n");

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

	int counter = 0;	
	List<SerializedEmbeddingRelationship> embRelationshipsToRead = new List<SerializedEmbeddingRelationship>();
	List<SerializedDomainClass> embRelationshipsTargetToRead = new List<SerializedDomainClass>();
	List<SerializedReferenceRelationship> refRelationshipsToRead = new List<SerializedReferenceRelationship>();
	List<SerializedDomainRole> refRelationshipsRoleToRead = new List<SerializedDomainRole>();
	List<AttributedDomainElement> createDerivedClassLookupFor = new List<AttributedDomainElement>();
	propertiesToReadInThisClass.Clear();
	foreach(SerializationElement child in Children )
	{
		if( child is SerializedDomainProperty )
		{
			SerializedDomainProperty sP = child as SerializedDomainProperty;
			DomainProperty p = sP.DomainProperty;
				
			if( sP.SerializationRepresentationType != SerializationRepresentationType.Element )
				continue;
				
			if( p.Element.GetMetaModel() == this.MetaModel && p.Element == domainClass)
				propertiesToReadInThisClass.Add(sP);

			if( sP.SerializationName == "" )
			{

        
        #line default
        #line hidden
        
        #line 427 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tError because the SerializationName of SerializedDomainProperty (");

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

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

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

			}
			else
			{			

        
        #line default
        #line hidden
        
        #line 433 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tif( readerLocalName == \"");

        
        #line default
        #line hidden
        
        #line 434 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

        
        #line default
        #line hidden
        
        #line 436 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, reader);\r\n\t\t\treturn true;\r\n\t\t}\r\n");

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

			}				
		}
		else if( child is SerializedEmbeddingRelationship )
		{
			SerializedEmbeddingRelationship sCon = child as SerializedEmbeddingRelationship;
			EmbeddingRelationship con = sCon.EmbeddingRelationship;
			
			if( sCon.OmitRelationship )
				continue;
			
			if( con.GetMetaModel() == this.MetaModel && con.Source.RolePlayer == domainClass)
				embRelationshipsToRead.Add(sCon);

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

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

        
        #line default
        #line hidden
        
        #line 453 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, reader, readerLocalName) )\r\n\t\t\treturn true;\r\n");

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

		}
		else if( child is SerializedReferenceRelationship && !(domainClass is EmbeddingRelationship))
		{
			SerializedReferenceRelationship sCon = child as SerializedReferenceRelationship;
			ReferenceRelationship con = sCon.ReferenceRelationship;
			
			if( sCon.OmitRelationship )
				continue;
			
			if( con.GetMetaModel() == this.MetaModel && con.Source.RolePlayer == domainClass)
				refRelationshipsToRead.Add(sCon);

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

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

        
        #line default
        #line hidden
        
        #line 468 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, reader, readerLocalName) )\r\n\t\t\treturn true;\r\n");

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

		}
		else if( child is SerializedDomainClass && domainClass is EmbeddingRelationship )
		{
			SerializedDomainClass sDomainClass = child as SerializedDomainClass;
			DomainClass d = sDomainClass.DomainClass;
			EmbeddingRelationship con = domainClass as EmbeddingRelationship;
						
			if( d.GetMetaModel() == this.MetaModel )
			{
				embRelationshipsTargetToRead.Add(sDomainClass);

				if( !createDerivedClassLookupFor.Contains(d) )
					createDerivedClassLookupFor.Add(d );				
			}

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

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

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

        
        #line default
        #line hidden
        
        #line 486 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, reader, readerLocalName) )\r\n\t\t\treturn true;\r\n");

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

		}
		else if( child is SerializedDomainRole && domainClass is ReferenceRelationship )
		{
			SerializedDomainRole dRole = child as SerializedDomainRole;
			ReferenceRelationship con = domainClass as ReferenceRelationship;
			
			if( dRole.DomainRole.RolePlayer.GetMetaModel() == this.MetaModel )
				refRelationshipsRoleToRead.Add(dRole);			

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

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

        
        #line default
        #line hidden
        
        #line 498 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dRole.DomainRole.Name));

        
        #line default
        #line hidden
        
        #line 498 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, reader, readerLocalName) )\r\n\t\t\treturn true;\r\n");

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

		}
	}

        
        #line default
        #line hidden
        
        #line 503 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n\t\treturn false;  // Don\'t know this element.\r\n\t}\r\n\t\r\n");

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

			foreach(SerializedDomainProperty sP in propertiesToReadInThisClass)
			{
				DomainProperty p = sP.DomainProperty;
				
				string isReq = "false";
				if( p.IsRequired )
					isReq = "true";
				
				if( sP.SerializationRepresentationType != SerializationRepresentationType.Element )
					continue;
				
				string modifier = "virtual";
				if( CodeGenerationUtilities.HasProperty(domainClass.BaseElement, p.Name))
					modifier = "override";

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

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

        
        #line default
        #line hidden
        
        #line 525 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that need to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=\"s" +
        "erializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instance\"" +
        ">");

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

        
        #line default
        #line hidden
        
        #line 528 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""reader"">XmlWriter to write serialized data to.</param> 
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected ");

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

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

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

        
        #line default
        #line hidden
        
        #line 531 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 531 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlReader reader)\r\n\t{\r\n\t\tif (reader.IsEmptyElement)" +
        "\r\n\t\t{\t// No serialized value, must be default one.\r\n\t\t\tDslModeling::Serializatio" +
        "nUtilities.Skip(reader);  // Skip this tag.\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n");

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

				if( p.Type.SerializationStyle == SerializationStyle.CDATA )					
				{

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

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

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

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

        
        #line default
        #line hidden
        
        #line 543 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ReadElementCDATAContentAsString(serializationContext" +
        ", instance, reader);\r\n");

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

				}
				else
				{

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

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

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

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

        
        #line default
        #line hidden
        
        #line 549 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ReadElementContentAsString(serializationContext, ins" +
        "tance, reader);\r\n");

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

				}

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

        
        #line default
        #line hidden
        
        #line 554 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(p)));

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

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

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

        
        #line default
        #line hidden
        
        #line 554 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Type.MetaModel.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 554 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertTypedObjectFrom(serializationContext, instanc" +
        "e, \"");

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

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

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

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

        
        #line default
        #line hidden
        
        #line 554 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(p)));

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

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

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

        
        #line default
        #line hidden
        
        #line 554 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(p)));

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

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

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

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

        
        #line default
        #line hidden
        
        #line 555 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\t\t//DslModeling::SerializationUtilities.SkipToNextElement(reader);\r\n\t\t\tDslMod" +
        "eling::SerializationUtilities.Skip(reader);\r\n\t\t}\r\n\t}\r\n");

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

			}
			
			foreach(SerializedEmbeddingRelationship sCon in embRelationshipsToRead)
			{
				EmbeddingRelationship con = sCon.EmbeddingRelationship;
				string modifier ="virtual";
				if( CodeGenerationUtilities.HasRelationship(domainClass.BaseElement, con.Name))
					modifier = "override";				

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

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

        
        #line default
        #line hidden
        
        #line 571 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that needed to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=" +
        "\"serializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instanc" +
        "e\">");

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

        
        #line default
        #line hidden
        
        #line 574 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""reader"">XmlWriter to write serialized data to.</param> 
	/// <param name=""readerLocalName"">Local name.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected ");

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

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

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

        
        #line default
        #line hidden
        
        #line 578 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 578 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlReader reader, string readerLocalName)\r\n\t{\r\n");

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

		if( sCon.IsTargetIncludedSubmodel )
		{
			DomainClass targetClass = con.Target.RolePlayer as DomainClass;

        
        #line default
        #line hidden
        
        #line 584 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"		if (reader.LocalName == ""include"")
        {
 			string attributeValue = reader.GetAttribute(""href"");
            if (attributeValue != null)
            {
				try 
				{
            	    // get parent's path
   	    			DslEditorModeling::IParentModelElement parent = instance.GetDomainModelServices().ElementParentProvider.GetParentModelElement(instance);
            		if (parent == null)
                		throw new System.ArgumentNullException(""Parent of element "" + instance.ToString() + "" can not be null"");
			
					string path = parent.DomainFilePath;
            		string vModellDirectory = new System.IO.FileInfo(path).DirectoryName;
					
            	    // get current's path
            	    string curPath = attributeValue;
            	    if( !curPath.Contains(System.IO.Path.VolumeSeparatorChar.ToString()))
            	    {
            	        curPath = vModellDirectory + System.IO.Path.DirectorySeparatorChar + curPath;
            	    }

            	    if (System.IO.File.Exists(curPath))
            	    {
            	        // load VModell file
						");

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

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

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

        
        #line default
        #line hidden
        
        #line 610 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.LoadModel");

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

        
        #line default
        #line hidden
        
        #line 610 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext.Result, instance.Store.DefaultPartition, curPath, null, nul" +
        "l, null);\r\n\t\t\t\t\t\tnew ");

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

        
        #line default
        #line hidden
        
        #line 611 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"(instance, target);
            	    }
            	    else
            	    {
            	        DslModeling::SerializationUtilities.AddMessage(serializationContext, DslModeling::SerializationMessageKind.Error,
            	            ""Could not include referenced Model: File not found"", reader as global::System.Xml.IXmlLineInfo);
            	    }
			
					DslModeling::SerializationUtilities.Skip(reader);
					return true;
				}
				catch {}
            }

            DslModeling::SerializationUtilities.Skip(reader);
		}
");

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

		}
		else
		{
			
				
			bool bSerializeInFullForm = con.NeedsFullSerialization() || sCon.IsInFullSerialization;
			if( !bSerializeInFullForm )
			{
				if( !createDerivedClassLookupFor.Contains(con.Target.RolePlayer) )
					createDerivedClassLookupFor.Add(con.Target.RolePlayer);

        
        #line default
        #line hidden
        
        #line 638 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tSystem.Guid info;\r\n\t\tif( readerLocalName == \"");

        
        #line default
        #line hidden
        
        #line 640 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.SerializationName));

        
        #line default
        #line hidden
        
        #line 640 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\" )\r\n\t\t{\r\n\t\t\tinfo = ");

        
        #line default
        #line hidden
        
        #line 642 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 642 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId;\r\n\t\t}\r\n\t\telse // derived classes\r\n\t\t{\r\n\t\t\tinfo = DslEditorModeling" +
        "::SerializationHelper.TryGetFirstEmbeddedDerivedNameType(");

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

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

        
        #line default
        #line hidden
        
        #line 646 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 646 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId, readerLocalName);\r\n\t\t}\r\n\t\tif( info != System.Guid.Empty )\r\n\t\t{\r\n\t" +
        "\t\tif (!serializationContext.Result.Failed)\r\n\t\t\t{\r\n\t\t\t\tDslModeling::DomainClassXm" +
        "lSerializer serializer");

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

        
        #line default
        #line hidden
        
        #line 652 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" = serializationContext.Directory.GetSerializer(info);\r\n\t\t\t\tglobal::System.Diagno" +
        "stics.Debug.Assert(serializer");

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

        
        #line default
        #line hidden
        
        #line 653 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null, \"Cannot find serializer for \" + info + \"!\");\r\n\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

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

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

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

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

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".TryCreateInstance(serializationContext, reader, instance.Partition) as ");

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 654 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\t\t\tif( child");

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

        
        #line default
        #line hidden
        
        #line 655 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t\t\t{\r\n\t\t\t\t\tnew ");

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 658 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".Read(serializationContext, child");

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

        
        #line default
        #line hidden
        
        #line 658 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(", reader);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tDslModeling::SerializationUtilities.Skip(reader" +
        ");\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n");

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

				//List<string> usedElements = new List<string>();
				//GenerateSaveEmbMethod(usedElements, con, con.Target.RolePlayer, ref counter);
			}
			else
			{

        
        #line default
        #line hidden
        
        #line 672 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tif(readerLocalName == \"");

        
        #line default
        #line hidden
        
        #line 673 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sCon.SerializationName));

        
        #line default
        #line hidden
        
        #line 673 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\" )\r\n\t\t{\r\n\t\t\tif (!serializationContext.Result.Failed)\r\n\t\t\t{\r\n\t\t\t\tDslModeling::Dom" +
        "ainClassXmlSerializer serializer");

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

        
        #line default
        #line hidden
        
        #line 677 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" = serializationContext.Directory.GetSerializer(");

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

        
        #line default
        #line hidden
        
        #line 677 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId);\r\n\t\t\t\tglobal::System.Diagnostics.Debug.Assert(serializer");

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

        
        #line default
        #line hidden
        
        #line 678 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null, \"Cannot find serializer for ");

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

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

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 679 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".TryCreateInstance(serializationContext, reader, instance.Partition) as ");

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

        
        #line default
        #line hidden
        
        #line 679 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\t\t\tif( connection");

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

        
        #line default
        #line hidden
        
        #line 680 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t\t\t{\r\n\t\t\t\t\tconnection");

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

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

        
        #line default
        #line hidden
        
        #line 682 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.Name));

        
        #line default
        #line hidden
        
        #line 682 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" = instance;\r\n\t\t\t\t\tserializer");

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

        
        #line default
        #line hidden
        
        #line 683 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".Read(serializationContext, connection");

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

        
        #line default
        #line hidden
        
        #line 683 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(", reader);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( connection");

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

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

        
        #line default
        #line hidden
        
        #line 685 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.Name));

        
        #line default
        #line hidden
        
        #line 685 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" == null ||\r\n\t\t\t\t\t\tconnection");

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

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

        
        #line default
        #line hidden
        
        #line 686 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

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

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

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

        
        #line default
        #line hidden
        
        #line 687 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetMetaModel().Name));

        
        #line default
        #line hidden
        
        #line 687 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationPostProcessor.Instance.AddRelationshipTrackData(connection");

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

        
        #line default
        #line hidden
        
        #line 687 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".Id);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tDslModeling::SerializationUtilities.Skip(reader" +
        ");\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n");

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

			}
		}

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

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

			}
			
			foreach(SerializedReferenceRelationship sCon in refRelationshipsToRead)
			{
				ReferenceRelationship con = sCon.ReferenceRelationship;
				
				string modifier ="";
				if( CodeGenerationUtilities.HasRelationship(domainClass.BaseElement, con.Name))
					modifier = "new ";

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

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

        
        #line default
        #line hidden
        
        #line 713 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that needed to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=" +
        "\"serializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instanc" +
        "e\">");

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

        
        #line default
        #line hidden
        
        #line 716 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""readr"">XmlWriter to write serialized data to.</param> 
	/// <param name=""readerLocalName"">Local name.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected ");

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

        
        #line default
        #line hidden
        
        #line 720 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("virtual bool ReadReferenceRelationship");

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

        
        #line default
        #line hidden
        
        #line 720 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 720 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlReader reader, string readerLocalName)\r\n\t{\r\n");

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

			bool bSerializeInFullForm = con.NeedsFullSerialization() || sCon.IsInFullSerialization;
			if( !bSerializeInFullForm )
			{

        
        #line default
        #line hidden
        
        #line 726 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tif( readerLocalName == \"");

        
        #line default
        #line hidden
        
        #line 727 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.SerializationTargetName));

        
        #line default
        #line hidden
        
        #line 727 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\")\r\n\t\t{\r\n\t\t\tstring attribValue");

        
        #line default
        #line hidden
        
        #line 729 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

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

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

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

        
        #line default
        #line hidden
        
        #line 729 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ReadAttribute(serializationContext, instance, reader" +
        ", \"");

        
        #line default
        #line hidden
        
        #line 729 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.SerializationAttributeName));

        
        #line default
        #line hidden
        
        #line 729 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\");\r\n\t\t\tif( attribValue");

        
        #line default
        #line hidden
        
        #line 730 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

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

        
        #line default
        #line hidden
        
        #line 730 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t\t{\r\n\t\t\t\tSystem.Guid id = ");

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

        
        #line default
        #line hidden
        
        #line 732 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertIdFrom(serializationContext, attribValue");

        
        #line default
        #line hidden
        
        #line 732 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

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

        
        #line default
        #line hidden
        
        #line 732 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(");\r\n\t\t\t\tif( id != System.Guid.Empty)\r\n\t\t\t\t{\r\n\t\t\t\t\t");

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

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

        
        #line default
        #line hidden
        
        #line 735 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetMetaModel().Name));

        
        #line default
        #line hidden
        
        #line 735 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationPostProcessor.Instance.AddPostProcessData(\r\n\t\t\t\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 736 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId, System.Guid.Empty, instance.Id, id);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tDslModeling" +
        "::SerializationUtilities.Skip(reader);\r\n\t\t\treturn true;\r\n\t\t}\r\n");

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

			}
			else
			{

        
        #line default
        #line hidden
        
        #line 746 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tif( readerLocalName == \"");

        
        #line default
        #line hidden
        
        #line 747 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sCon.SerializationName));

        
        #line default
        #line hidden
        
        #line 747 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\")\r\n\t\t{\r\n\t\t\tDslModeling::DomainClassXmlSerializer serializer");

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

        
        #line default
        #line hidden
        
        #line 749 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" = serializationContext.Directory.GetSerializer(");

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

        
        #line default
        #line hidden
        
        #line 749 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId);\r\n\t\t\tglobal::System.Diagnostics.Debug.Assert(serializer");

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

        
        #line default
        #line hidden
        
        #line 750 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null, \"Cannot find serializer for ");

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

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

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 751 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".TryCreateInstance(serializationContext, reader, instance.Partition) as ");

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

        
        #line default
        #line hidden
        
        #line 751 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\t\tif( connection");

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

        
        #line default
        #line hidden
        
        #line 752 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t\t{\r\n\t\t\t\tconnection");

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

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

        
        #line default
        #line hidden
        
        #line 754 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.Name));

        
        #line default
        #line hidden
        
        #line 754 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" = instance;\r\n\t\t\t\tserializer");

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

        
        #line default
        #line hidden
        
        #line 755 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".Read(serializationContext, connection");

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

        
        #line default
        #line hidden
        
        #line 755 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(", reader);\r\n\t\t\t\t\r\n\t\t\t\tif( connection");

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

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

        
        #line default
        #line hidden
        
        #line 757 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.Name));

        
        #line default
        #line hidden
        
        #line 757 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" == null ||\r\n\t\t\t\t\tconnection");

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

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

        
        #line default
        #line hidden
        
        #line 758 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

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

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

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

        
        #line default
        #line hidden
        
        #line 759 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetMetaModel().Name));

        
        #line default
        #line hidden
        
        #line 759 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationPostProcessor.Instance.AddRelationshipTrackData(connection");

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

        
        #line default
        #line hidden
        
        #line 759 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".Id);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tDslModeling::SerializationUtilities.Skip(reader);\r\n\t\t\tr" +
        "eturn true;\r\n\t\t}\r\n");

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

			}

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

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

			}
			
			foreach(SerializedDomainClass dS in embRelationshipsTargetToRead)
			{
				EmbeddingRelationship con = domainClass as EmbeddingRelationship;
				DomainClass d = dS.DomainClass;

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

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

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

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

        
        #line default
        #line hidden
        
        #line 780 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that needed to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=" +
        "\"serializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instanc" +
        "e\">");

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

        
        #line default
        #line hidden
        
        #line 783 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""reader"">XmlWriter to write serialized data to.</param> 
	/// <param name=""readerLocalName"">Local name.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected virtual bool ReadEmbeddingRelationshipTarget");

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

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

        
        #line default
        #line hidden
        
        #line 787 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 787 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlReader reader, string readerLocalName)\r\n\t{\r\n\t\tSy" +
        "stem.Guid info;\r\n\t\tif( readerLocalName == \"");

        
        #line default
        #line hidden
        
        #line 790 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.SerializationName));

        
        #line default
        #line hidden
        
        #line 790 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\" )\r\n\t\t{\r\n\t\t\tinfo = ");

        
        #line default
        #line hidden
        
        #line 792 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 792 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId;\r\n\t\t}\r\n\t\telse // derived classes\r\n\t\t{\r\n");

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

				if( domainClass is DomainRelationship )
				{

        
        #line default
        #line hidden
        
        #line 799 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\tinfo = DslEditorModeling::SerializationHelper.TryGetFirstEmbeddedDerivedNameTy" +
        "pe(");

        
        #line default
        #line hidden
        
        #line 800 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.RolePlayer.GetFullName(true)));

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

        
        #line default
        #line hidden
        
        #line 800 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

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

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

        
        #line default
        #line hidden
        
        #line 805 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\tinfo = DslEditorModeling::SerializationHelper.TryGetFirstEmbeddedDerivedNameTy" +
        "pe(");

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

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

        
        #line default
        #line hidden
        
        #line 806 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

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

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

				}

        
        #line default
        #line hidden
        
        #line 809 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\r\n\t\t}\r\n\t\tif( info != null )\r\n\t\t{\r\n\t\t\tif (!serializationContext.Result.Failed)\r" +
        "\n\t\t\t{\r\n\t\t\t\tDslModeling::DomainClassXmlSerializer serializer");

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

        
        #line default
        #line hidden
        
        #line 815 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" = serializationContext.Directory.GetSerializer(info);\r\n\t\t\t\tglobal::System.Diagno" +
        "stics.Debug.Assert(serializer");

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

        
        #line default
        #line hidden
        
        #line 816 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null, \"Cannot find serializer for \" + info + \"!\");\r\n\t\t\t\t");

        
        #line default
        #line hidden
        
        #line 817 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

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

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

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

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

        
        #line default
        #line hidden
        
        #line 817 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".TryCreateInstance(serializationContext, reader, instance.Partition) as ");

        
        #line default
        #line hidden
        
        #line 817 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.RolePlayer.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 817 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\t\t\tif( child");

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

        
        #line default
        #line hidden
        
        #line 818 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t\t\t{\r\n\t\t\t\t\tserializer");

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

        
        #line default
        #line hidden
        
        #line 820 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".Read(serializationContext, child");

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

        
        #line default
        #line hidden
        
        #line 820 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(", reader);\r\n\t\t\t\t\tinstance.");

        
        #line default
        #line hidden
        
        #line 821 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

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

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

        
        #line default
        #line hidden
        
        #line 821 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tDslModeling::SerializationUtilities.Skip(reader);\r\n\t\t\t}" +
        "\r\n\r\n\t\t\treturn true;\r\n\t\t}\t\r\n");

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

//		List<string> usedElements2 = new List<string>();
//		GenerateSaveEmbMethodTarget(usedElements2, con, d, ref counter);				

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

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

			}
			
			foreach(SerializedDomainRole dRole in refRelationshipsRoleToRead)
			{
				DomainRole role = dRole.DomainRole;
				ReferenceRelationship con = domainClass as ReferenceRelationship;				
				
			
				bool bSource = true;
				string roleName = con.Source.Name;
				if( con.Target == dRole.DomainRole )
				{
					bSource = false;
					roleName = con.Target.Name;
				}				

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

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

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

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

        
        #line default
        #line hidden
        
        #line 853 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that needed to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=" +
        "\"serializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instanc" +
        "e\">");

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

        
        #line default
        #line hidden
        
        #line 856 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""reader"">XmlWriter to write serialized data to.</param> 
	/// <param name=""readerLocalName"">Local name.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected virtual bool ReadReferenceRelationshipRole");

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

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

        
        #line default
        #line hidden
        
        #line 860 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 860 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlReader reader, string readerLocalName)\r\n\t{\r\n\t\tif" +
        "( readerLocalName ==  \"");

        
        #line default
        #line hidden
        
        #line 862 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dRole.SerializationName));

        
        #line default
        #line hidden
        
        #line 862 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\")\r\n\t\t{\r\n\t\t\tstring attribValue");

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

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

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

        
        #line default
        #line hidden
        
        #line 864 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ReadAttribute(serializationContext, instance, reader" +
        ", \"");

        
        #line default
        #line hidden
        
        #line 864 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dRole.SerializationAttributeName));

        
        #line default
        #line hidden
        
        #line 864 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\");\r\n\t\t\tif( attribValue");

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

        
        #line default
        #line hidden
        
        #line 865 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t\t{\r\n\t\t\t\tSystem.Guid id = ");

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

        
        #line default
        #line hidden
        
        #line 867 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertIdFrom(serializationContext, attribValue");

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

        
        #line default
        #line hidden
        
        #line 867 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(");\r\n\t\t\t\tif( id != System.Guid.Empty)\r\n\t\t\t\t{\r\n");

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

			if( bSource )
			{

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

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

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

        
        #line default
        #line hidden
        
        #line 874 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetMetaModel().Name));

        
        #line default
        #line hidden
        
        #line 874 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationPostProcessor.Instance.AddPostProcessData(\r\n\t\t\t\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 875 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId, instance.Id, id, System.Guid.Empty);\r\n\t\t\t\t\t");

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

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

        
        #line default
        #line hidden
        
        #line 876 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetMetaModel().Name));

        
        #line default
        #line hidden
        
        #line 876 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationPostProcessor.Instance.AddRelationshipTrackData(instance.Id);\r\n");

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

			}
			else
			{

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

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

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

        
        #line default
        #line hidden
        
        #line 882 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetMetaModel().Name));

        
        #line default
        #line hidden
        
        #line 882 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationPostProcessor.Instance.AddPostProcessData(\r\n\t\t\t\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 883 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId, instance.Id, System.Guid.Empty, id);\r\n\t\t\t\t\t");

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

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

        
        #line default
        #line hidden
        
        #line 884 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetMetaModel().Name));

        
        #line default
        #line hidden
        
        #line 884 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationPostProcessor.Instance.AddRelationshipTrackData(instance.Id);\r\n");

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

			}

        
        #line default
        #line hidden
        
        #line 887 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tDslModeling::SerializationUtilities.Skip(reader);\r\n\t\t\treturn true" +
        ";\t\r\n\t\t}\r\n\t\t\t\r\n\t\treturn false;\r\n\t}\r\n");

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

			}
	bool privateHelper = false;

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

        
        #line default
        #line hidden
        
        #line 901 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(isRelationship ? " & TryCreateDerivedInstance" : string.Empty));

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

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

	//string serInhModifier = "";
	//if( domainClass.BaseElement != null && (domainClass is DomainClass))
	//	if( (domainClass as DomainClass).GetMetaModel() == this.MetaModel )
	//		serInhModifier = "new ";

        
        #line default
        #line hidden
        
        #line 907 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t/// <summary>\r\n\t/// This method creates a correct instance of ");

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

        
        #line default
        #line hidden
        
        #line 909 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" based on the tag currently pointed by the reader. If the reader\r\n\t/// is positio" +
        "ned at a serialized ");

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

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

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

        
        #line default
        #line hidden
        
        #line 910 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance will be created in the given partition, otherwise 
	/// null is returned.
	/// </summary>
	/// <remarks>
	/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
	/// not move the reader; the reader should remain at the same position when this method returns.
	/// </remarks>
	/// <param name=""serializationContext"">Serialization context.</param>
	/// <param name=""reader"">XmlReader to read serialized data from.</param>
	/// <param name=""partition"">Partition in which new elements should be created.</param>	
	/// <returns>Created ");

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

        
        #line default
        #line hidden
        
        #line 920 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, or null if the reader is not pointing to a serialized ");

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

        
        #line default
        #line hidden
        
        #line 920 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance.</returns>
	public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
	{
		#region Check Parameters
		global::System.Diagnostics.Debug.Assert (serializationContext != null);
		if (serializationContext == null)
			throw new global::System.ArgumentNullException (""serializationContext"");
		global::System.Diagnostics.Debug.Assert (reader != null);
		if (reader == null)
			throw new global::System.ArgumentNullException (""reader"");
		global::System.Diagnostics.Debug.Assert (partition != null);
		if (partition == null)
			throw new global::System.ArgumentNullException (""partition"");
		#endregion

");

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

		if (isRelationship && !isSealed && !isAbstract)
		{	// For a non-abstract non-sealed relationship, the implementation of TryCreateDerivedInstance() is almost the same as 
			// TryCreateInstance(). So we generate the actual implementation into a private helper method to re-use
			// some code.
			privateHelper = true;

        
        #line default
        #line hidden
        
        #line 941 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\treturn this.InternalTryCreateInstance(serializationContext, reader, partition, " +
        "false /* include the type itself */);\r\n\t}\r\n\r\n\t/// <summary>\r\n\t/// This method cr" +
        "eates a correct derived instance of ");

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

        
        #line default
        #line hidden
        
        #line 946 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" based on the tag currently pointed by the reader.\r\n\t/// Note that the difference" +
        " between this method and the above one is that this method will never create an " +
        "instance of the\r\n\t/// ");

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

        
        #line default
        #line hidden
        
        #line 948 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" type itself, only derived types are checked.
	/// </summary>
	/// <remarks>
	/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
	/// not move the reader; the reader should remain at the same position when this method returns.
	/// </remarks>		
	/// <param name=""serializationContext"">Serialization context.</param>
	/// <param name=""reader"">XmlReader to read serialized data from.</param>
	/// <param name=""partition"">Partition in which new elements should be created.</param>
	/// <returns>Created instance that derives from ");

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

        
        #line default
        #line hidden
        
        #line 957 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(", or null if the reader is not pointing to such a serialized instance.</returns>\r" +
        "\n\tpublic override DslModeling::ElementLink TryCreateDerivedInstance (DslModeling" +
        "::SerializationContext serializationContext, global::System.Xml.XmlReader reader" +
        ", DslModeling::Partition partition)\r\n\t{\r\n\t\t#region Check Parameters\r\n\t\tglobal::S" +
        "ystem.Diagnostics.Debug.Assert (serializationContext != null);\r\n\t\tif (serializat" +
        "ionContext == null)\r\n\t\t\tthrow new global::System.ArgumentNullException (\"seriali" +
        "zationContext\");\r\n\t\tglobal::System.Diagnostics.Debug.Assert (reader != null);\r\n\t" +
        "\tif (reader == null)\r\n\t\t\tthrow new global::System.ArgumentNullException (\"reader" +
        "\");\r\n\t\tglobal::System.Diagnostics.Debug.Assert (partition != null);\r\n\t\tif (parti" +
        "tion == null)\r\n\t\t\tthrow new global::System.ArgumentNullException (\"partition\");\r" +
        "\n\t\t#endregion\r\n\r\n\t\treturn this.InternalTryCreateInstance(serializationContext, r" +
        "eader, partition, true /* derived types only */) as DslModeling::ElementLink;\r\n\t" +
        "}\r\n\r\n\t/// <summary>\r\n\t/// Internal helper method for TryCreateInstance() and Try" +
        "CreateDerivedInstance().\r\n\t/// </summary>\r\n\t/// <param name=\"serializationContex" +
        "t\">Serialization context.</param>\r\n\t/// <param name=\"reader\">XmlReader to read s" +
        "erialized data from.</param>\r\n\t/// <param name=\"partition\">Partition in which ne" +
        "w elements should be created.</param>\r\n\t/// <param name=\"derivedTypesOnly\">If tr" +
        "ue, this method will only check derived types, but not the domain class iitself." +
        "</param>\r\n\tprivate DslModeling::ModelElement InternalTryCreateInstance (DslModel" +
        "ing::SerializationContext serializationContext, global::System.Xml.XmlReader rea" +
        "der, DslModeling::Partition partition, bool derivedTypesOnly)\r\n\t{\r\n");

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

		}

        
        #line default
        #line hidden
        
        #line 986 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tDslModeling::ModelElement result = null;\r\n\t\tif (!serializationContext.Result.Fa" +
        "iled && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element" +
        ")\r\n\t\t{\r\n\t\t\tstring localName = reader.LocalName;\r\n");

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

		if (!isAbstract)
		{

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

        
        #line default
        #line hidden
        
        #line 995 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(privateHelper ? "!derivedTypesOnly && " : string.Empty));

        
        #line default
        #line hidden
        
        #line 995 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("string.Compare (localName, this.XmlTagName, global::System.StringComparison.Curre" +
        "ntCulture) == 0)\r\n\t\t\t{\t// New \"");

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

        
        #line default
        #line hidden
        
        #line 996 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\" instance.\r\n\t\t\t\tresult = this.CreateInstance(serializationContext, reader, parti" +
        "tion);\r\n\t\t\t}\r\n");

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

			if (!isSealed)
			{

        
        #line default
        #line hidden
        
        #line 1002 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\telse\r\n\t\t\t{\t// Check for derived classes of \"");

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

        
        #line default
        #line hidden
        
        #line 1004 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\".\r\n\t\t\t\t//if (derivedClasses == null)\r\n\t\t\t\t//\tConstructDerivedClassesLookupTable");

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

        
        #line default
        #line hidden
        
        #line 1006 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"(serializationContext.Directory, partition.DomainDataDirectory);
				//global::System.Diagnostics.Debug.Assert (derivedClasses != null);
				//DslModeling::DomainClassInfo derivedClass = null;
				System.Guid derivedType = DslEditorModeling::SerializationHelper.TryGetDerivedNameType(");

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

        
        #line default
        #line hidden
        
        #line 1009 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId, localName);\r\n\t\t\t\tif( derivedType != System.Guid.Empty )\r\n\t\t\t\t//if" +
        " (derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != nu" +
        "ll)\r\n\t\t\t\t{\t// New derived ");

        
        #line default
        #line hidden
        
        #line 1012 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(isRelationship ? "relationship" : "class"));

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

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

        
        #line default
        #line hidden
        
        #line 1013 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id" +
        ") as ");

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

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

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

        
        #line default
        #line hidden
        
        #line 1014 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" derivedSerializer = serializationContext.Directory.GetSerializer(derivedType) as" +
        " ");

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

        
        #line default
        #line hidden
        
        #line 1014 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\t\t\t\tglobal::System.Diagnostics.Debug.Assert(derivedSerializer != null, \"Canno" +
        "t find serializer for \" + derivedType + \"!\");\r\n\t\t\t\t\tresult = derivedSerializer.C" +
        "reateInstance(serializationContext, reader, partition);\r\n\t\t\t\t}\r\n\t\t\t}\r\n");

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

			}
		}
		else
		{

        
        #line default
        #line hidden
        
        #line 1024 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t// Check for derived classes of \"");

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

        
        #line default
        #line hidden
        
        #line 1025 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\".\r\n\t\t\t//if (derivedClasses == null)\r\n\t\t\t//\tConstructDerivedClassesLookupTable");

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

        
        #line default
        #line hidden
        
        #line 1027 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"(serializationContext.Directory, partition.DomainDataDirectory);
			//global::System.Diagnostics.Debug.Assert (derivedClasses != null);
			//DslModeling::DomainClassInfo derivedClass = null;
			System.Guid derivedType = DslEditorModeling::SerializationHelper.TryGetDerivedNameType(");

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

        
        #line default
        #line hidden
        
        #line 1030 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".DomainClassId, localName);\r\n\t\t\tif( derivedType != System.Guid.Empty )\r\n\t\t\t//if (" +
        "derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null" +
        ")\r\n\t\t\t{\t// New derived ");

        
        #line default
        #line hidden
        
        #line 1033 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(isRelationship ? "relationship" : "class"));

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

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

        
        #line default
        #line hidden
        
        #line 1034 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id" +
        ") as ");

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

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

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

        
        #line default
        #line hidden
        
        #line 1035 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" derivedSerializer = serializationContext.Directory.GetSerializer(derivedType) as" +
        " ");

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

        
        #line default
        #line hidden
        
        #line 1035 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\t\t\tglobal::System.Diagnostics.Debug.Assert(derivedSerializer != null, \"Cannot" +
        " find serializer for \" + derivedType + \"!\");\r\n\t\t\t\tresult = derivedSerializer.Cre" +
        "ateInstance(serializationContext, reader, partition);\r\n\t\t\t}\r\n");

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

		}

        
        #line default
        #line hidden
        
        #line 1041 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t/// <summary>\r\n\t/// This method creates an instan" +
        "ce of ");

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

        
        #line default
        #line hidden
        
        #line 1048 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" based on the tag currently pointed by the reader. The reader is guaranteed (by t" +
        "he caller)\r\n\t/// to be pointed at a serialized instance of ");

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

        
        #line default
        #line hidden
        
        #line 1049 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@".
	/// </summary>
	/// <remarks>
	/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
	/// not move the reader; the reader should remain at the same position when this method returns.
	/// </remarks>
	/// <param name=""serializationContext"">Serialization context.</param>
	/// <param name=""reader"">XmlReader to read serialized data from.</param>
	/// <param name=""partition"">Partition in which new ");

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

        
        #line default
        #line hidden
        
        #line 1057 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance should be created.</param>\t\r\n\t/// <returns>Created ");

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

        
        #line default
        #line hidden
        
        #line 1058 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance.</returns>\r\n\tprotected override DslModeling::ModelElement CreateInstanc" +
        "e(DslModeling::SerializationContext serializationContext, global::System.Xml.Xml" +
        "Reader reader, DslModeling::Partition partition)\r\n\t{\r\n");

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

		if (isAbstract)
		{

        
        #line default
        #line hidden
        
        #line 1064 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t// Abstract class, cannot be serialized.\r\n\t\tthrow new global::System.NotSupport" +
        "edException();\r\n");

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

		}
		else
		{

        
        #line default
        #line hidden
        
        #line 1071 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tstring idStr = reader.GetAttribute (");

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

        
        #line default
        #line hidden
        
        #line 1072 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationBehavior.Instance.IdSerializationName");

        
        #line default
        #line hidden
        
        #line 1072 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.ParentModelContext.Name));

        
        #line default
        #line hidden
        
        #line 1072 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(");\r\n\t\ttry\r\n\t\t{\r\n\t\t\tglobal::System.Guid id;\r\n\t\t\tif (string.IsNullOrEmpty(idStr))\r\n" +
        "\t\t\t{\t// Create a default Id.\r\n\t\t\t\tid = ");

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

        
        #line default
        #line hidden
        
        #line 1078 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("DomainModelIdProvider.Instance.GenerateNewKey();\r\n");

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

				if( !bOmitIdProperty )
				{

        
        #line default
        #line hidden
        
        #line 1082 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\tDslModeling::SerializationUtilities.AddMessage(serializationContext,DslModeli" +
        "ng::SerializationMessageKind.Warning,\r\n\t\t\t\t\t\"Missing \'Id\' attribute, a new Guid " +
        "\" + id.ToString() + \" is auto-generated. Element type (");

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

        
        #line default
        #line hidden
        
        #line 1084 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(")\",\r\n\t    \t\t\treader as global::System.Xml.IXmlLineInfo);\r\n\t\t\t\t//");

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

        
        #line default
        #line hidden
        
        #line 1086 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationBehaviorSerializationMessages.MissingId(serializationContext, reader" +
        ", id);\r\n");

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

				}

        
        #line default
        #line hidden
        
        #line 1089 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tid = ");

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

        
        #line default
        #line hidden
        
        #line 1093 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertIdFrom(serializationContext, idStr);\r\n\t\t\t}\r\n");

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

				if (!isRelationship)
				{

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

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

        
        #line default
        #line hidden
        
        #line 1099 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPro" +
        "pertyAssignment, id));\r\n");

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

				}
				else
				{
					DomainRole nonAnchorRole = (domainClass as DomainRelationship).Target;
					DomainRole anchorRole = nonAnchorRole.Opposite;

        
        #line default
        #line hidden
        
        #line 1106 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\r\n\t\t\t// Create the link with place-holder role-players.\r\n\t\t\treturn new ");

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

        
        #line default
        #line hidden
        
        #line 1109 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(\r\n\t\t\t\tpartition,\r\n\t\t\t\tnew DslModeling::RoleAssignment[] {\r\n\t\t\t\t\tDslModeling::Rol" +
        "eAssignment.CreatePlaceholderRoleAssignment (");

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

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

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

        
        #line default
        #line hidden
        
        #line 1112 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("DomainRoleId), \r\n\t\t\t\t\tDslModeling::RoleAssignment.CreatePlaceholderRoleAssignment" +
        " (");

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

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

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

        
        #line default
        #line hidden
        
        #line 1113 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("DomainRoleId)\r\n\t\t\t\t},\r\n\t\t\t\tnew DslModeling::PropertyAssignment[] {\r\n\t\t\t\t\tnew DslM" +
        "odeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id" +
        ")\r\n\t\t\t\t}\r\n\t\t\t);\r\n");

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

				}

        
        #line default
        #line hidden
        
        #line 1121 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t}\r\n\t\tcatch (global::System.ArgumentNullException /* anEx */)\r\n\t\t{\t\r\n\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 1125 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationCont" +
        "ext, reader, \"Id\", typeof(global::System.Guid), idStr);\r\n\t\t}\r\n\t\tcatch (global::S" +
        "ystem.FormatException /* fEx */)\r\n\t\t{\r\n\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 1129 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationCont" +
        "ext, reader, \"Id\", typeof(global::System.Guid), idStr);\r\n\t\t}\r\n\t\tcatch (global::S" +
        "ystem.OverflowException /* ofEx */)\r\n\t\t{\r\n\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 1133 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationCont" +
        "ext, reader, \"Id\", typeof(global::System.Guid), idStr);\r\n\t\t}\r\n\t\treturn null;\r\n");

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

			
		}

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

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

		if (isRelationship && !privateHelper)
		{

        
        #line default
        #line hidden
        
        #line 1144 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n\t/// <summary>\r\n\t/// This method creates a correct derived instance of ");

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

        
        #line default
        #line hidden
        
        #line 1147 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" based on the tag currently pointed by the reader.\r\n\t/// Note that the difference" +
        " between this method and the above one is that this method will never create an " +
        "instance of the\r\n\t/// ");

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

        
        #line default
        #line hidden
        
        #line 1149 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" type itself, only derived types are checked.
	/// </summary>
	/// <remarks>
	/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
	/// not move the reader; the reader should remain at the same position when this method returns.
	/// </remarks>		
	/// <param name=""serializationContext"">Serialization context.</param>
	/// <param name=""reader"">XmlReader to read serialized data from.</param>
	/// <param name=""partition"">Partition in which new elements should be created.</param>
	/// <returns>Created instance that derives from ");

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

        
        #line default
        #line hidden
        
        #line 1158 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@", or null if the reader is not pointing to such a serialized instance.</returns>
	public override DslModeling::ElementLink TryCreateDerivedInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
");

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

			if (isAbstract)
			{	// For abstract relationship, TryCreateDerivedInstance() and TryCreateInstance() will be the same

        
        #line default
        #line hidden
        
        #line 1163 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t{\t// Abstract relationship, so it\'s the same as TryCreateInstance().\r\n\t\treturn t" +
        "his.TryCreateInstance(serializationContext, reader, partition) as DslModeling::E" +
        "lementLink;\r\n");

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

			}
			else // Must be sealed.
			{	// Sealed relationship won't have derived instances.		

        
        #line default
        #line hidden
        
        #line 1170 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t{\t// Sealed relationship, won\'t have any derived instances.\r\n\t\treturn null;\r\n");

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

			}

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

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

		}

        
        #line default
        #line hidden
        
        #line 1179 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t#endregion\r\n\t#endregion\r\n\r\n\t#region Write\r\n\t/// <summary>\r\n\t/// Public Write() m" +
        "ethod that serializes one ");

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

        
        #line default
        #line hidden
        
        #line 1185 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance into XML.\r\n\t/// </summary>\r\n\t/// <param name=\"serializationContext\">Ser" +
        "ialization context.</param>\r\n\t/// <param name=\"element\">");

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

        
        #line default
        #line hidden
        
        #line 1188 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param>
	/// <param name=""rootElementSettings"">
	/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
	/// information like schema target namespace, version, etc.
	/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
	/// without this parameter).
	/// </param>
	/// <param name=""options"">Serialization options.</param>
	public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings, DslEditorModeling::SerializationOptions options)
	{
");

        
        #line default
        #line hidden
        
        #line 1199 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
 
	if( isAbstract )
	{

        
        #line default
        #line hidden
        
        #line 1202 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tthrow new global::System.NotSupportedException();\r\n");

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

	}
	else
	{

        
        #line default
        #line hidden
        
        #line 1208 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"		#region Check Parameters
		global::System.Diagnostics.Debug.Assert (serializationContext != null);
		if (serializationContext == null)
			throw new global::System.ArgumentNullException (""serializationContext"");
		global::System.Diagnostics.Debug.Assert (element != null);
		if (element == null)
			throw new global::System.ArgumentNullException (""element"");
		global::System.Diagnostics.Debug.Assert (writer != null);
		if (writer == null)
			throw new global::System.ArgumentNullException (""writer"");
		#endregion

		// Write start of element, including schema target namespace if specified.
		writer.WriteStartElement(this.XmlTagName);
		
");

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

	if( domainClass is DomainClass )
		if( (domainClass as DomainClass).IsDomainModel)
		{

        
        #line default
        #line hidden
        
        #line 1228 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\r\n\t\tif(rootElementSettings != null )\r\n\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 1230 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteSchemaDefinitions(writer, \"");

        
        #line default
        #line hidden
        
        #line 1230 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture((domainClass as DomainClass).ModelContext.Name));

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

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

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

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

		}
		if( propertySerializedAsInnerValue != null )
		{
			string isReq = "false";
			if( propertySerializedAsInnerValue.IsRequired )
				isReq = "true";

        
        #line default
        #line hidden
        
        #line 1239 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t// Write inner value property\r\n\t\t");

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

        
        #line default
        #line hidden
        
        #line 1241 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance = element as ");

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

        
        #line default
        #line hidden
        
        #line 1241 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\t\r\n\t\tobject value");

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

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

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

        
        #line default
        #line hidden
        
        #line 1242 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertTypedObjectTo(serializationContext,instance, " +
        "\"");

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

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

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

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

        
        #line default
        #line hidden
        
        #line 1242 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(propertySerializedAsInnerValue)));

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

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

        
        #line default
        #line hidden
        
        #line 1242 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(");\t\t\r\n\t\tif( value");

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

        
        #line default
        #line hidden
        
        #line 1243 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t{\r\n");

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

			if( propertySerializedAsInnerValue.Type.SerializationStyle == SerializationStyle.CDATA )					
			{

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

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

        
        #line default
        #line hidden
        
        #line 1249 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteCDATAFromInnerXmlAsString(serializationContext," +
        " instance, writer, \"");

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

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

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

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

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

			}
			else
			{

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

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

        
        #line default
        #line hidden
        
        #line 1255 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteInnerXmlAsString(serializationContext, instance" +
        ", writer, \"");

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

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

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

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

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

			}

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

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

		}

        
        #line default
        #line hidden
        
        #line 1262 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"		if (!serializationContext.Result.Failed)
		{
			WritePropertiesAsAttributes(serializationContext, element, writer, options);
		}

		if (!serializationContext.Result.Failed)
		{
			// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
			WriteElements(serializationContext, element, writer, options);
		}
		writer.WriteEndElement();
");

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

	}

        
        #line default
        #line hidden
        
        #line 1276 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t}\r\n\r\n\t/// <summary>\r\n\t/// Write all properties that need to be serialized as XML" +
        " attributes.\r\n\t/// </summary>\r\n\t/// <param name=\"serializationContext\">Serializa" +
        "tion context.</param>\r\n\t/// <param name=\"element\">");

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

        
        #line default
        #line hidden
        
        #line 1283 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param> 
	/// <param name=""options"">Serialization options.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected override void WritePropertiesAsAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslEditorModeling::SerializationOptions options)
	{
		");

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

        
        #line default
        #line hidden
        
        #line 1289 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance = element as ");

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

        
        #line default
        #line hidden
        
        #line 1289 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\tglobal::System.Diagnostics.Debug.Assert(instance != null, \"Expecting an inst" +
        "ance of ");

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

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

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

		List<SerializedDomainProperty> propertiesToWriteInThisClass = new List<SerializedDomainProperty>();
		if( Attributes != null )
			foreach(SerializationAttributeElement attr in Attributes)
			{
				if( attr is SerializedIdProperty)
				{
					if( !bOmitIdProperty )
					{

        
        #line default
        #line hidden
        
        #line 1301 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t// Domain Element Id\r\n\t\tstring valueId = ");

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

        
        #line default
        #line hidden
        
        #line 1303 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertIdTo(serializationContext, element.Id);\r\n\t\twr" +
        "iter.WriteAttributeString(");

        
        #line default
        #line hidden
        
        #line 1304 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.MetaModel.Name+"SerializationBehavior"));

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

        
        #line default
        #line hidden
        
        #line 1304 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.ParentModelContext.Name));

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

        
        #line default
        #line hidden
        
        #line 1306 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
		
					}					
				}
				else if( attr is SerializedDomainProperty)
				{
					SerializedDomainProperty sP = attr as SerializedDomainProperty;
					DomainProperty p = sP.DomainProperty;
					
					if( sP.OmitProperty )
						continue;
					
					if( p.Element.GetMetaModel() == this.MetaModel && p.Element == domainClass)
						propertiesToWriteInThisClass.Add(sP);


        
        #line default
        #line hidden
        
        #line 1320 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tif (!serializationContext.Result.Failed)\r\n\t\t{\r\n\t\t\tWritePropertyAsAttribute");

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

        
        #line default
        #line hidden
        
        #line 1323 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, writer, options);\r\n\t\t}\r\n");

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

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

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

			foreach(SerializedDomainProperty sP in propertiesToWriteInThisClass)
			{
				DomainProperty p = sP.DomainProperty;
				
				string isReq = "false";
				if( p.IsRequired )
					isReq = "true";
				
				if( sP.SerializationRepresentationType != SerializationRepresentationType.Attribute )
					continue;

				string modifier ="virtual";
				if( CodeGenerationUtilities.HasProperty(domainClass.BaseElement, p.Name))
					modifier = "override";

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

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

        
        #line default
        #line hidden
        
        #line 1348 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that need to be serialized as XML attribute.\r\n\t/// </summary>\r\n\t/// <param name=" +
        "\"serializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instanc" +
        "e\">");

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

        
        #line default
        #line hidden
        
        #line 1351 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param> 
	/// <param name=""options"">Serialization options.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected ");

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

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

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

        
        #line default
        #line hidden
        
        #line 1355 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 1355 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlWriter writer, DslEditorModeling::SerializationO" +
        "ptions options)\r\n\t{\r\n\t\t// ");

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

        
        #line default
        #line hidden
        
        #line 1357 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n\t\tobject value");

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

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

        
        #line default
        #line hidden
        
        #line 1358 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Type.MetaModel.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1358 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertTypedObjectTo(serializationContext,instance, " +
        "\"");

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

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

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

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

        
        #line default
        #line hidden
        
        #line 1358 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(p)));

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

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

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

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

		if( String.IsNullOrEmpty(p.DefaultValue) )
		{

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

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

        
        #line default
        #line hidden
        
        #line 1363 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t{\r\n\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 1365 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteAttributeString(serializationContext, instance," +
        " writer, \"");

        
        #line default
        #line hidden
        
        #line 1365 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

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

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

		}
		else
		{

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

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

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

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

        
        #line default
        #line hidden
        
        #line 1373 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteAttributeString(serializationContext, instance," +
        " writer, \"");

        
        #line default
        #line hidden
        
        #line 1373 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

        
        #line default
        #line hidden
        
        #line 1373 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".ToString());\r\n\t\telse\r\n\t\t\t");

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

        
        #line default
        #line hidden
        
        #line 1375 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteAttributeString(serializationContext, instance," +
        " writer, \"");

        
        #line default
        #line hidden
        
        #line 1375 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

		}

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

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

			}

        
        #line default
        #line hidden
        
        #line 1382 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\r\n\t/// <summary>\r\n\t/// This methods serializes 1) properties serialized as neste" +
        "d XML elements and 2) child model elements into XML. \r\n\t/// </summary>\r\n\t/// <pa" +
        "ram name=\"serializationContext\">Serialization context.</param>\r\n\t/// <param name" +
        "=\"element\">");

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

        
        #line default
        #line hidden
        
        #line 1388 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param>        
	/// <param name=""options"">Serialization options.</param>
	protected override void WriteElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslEditorModeling::SerializationOptions options)
	{
");

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

	List<SerializedEmbeddingRelationship> embRelationshipsToWrite = new List<SerializedEmbeddingRelationship>();
	List<SerializedDomainClass> embRelationshipsTargetToWrite = new List<SerializedDomainClass>();
	List<SerializedReferenceRelationship> refRelationshipsToWrite = new List<SerializedReferenceRelationship>();
	List<SerializedDomainRole> refRelationshipsRoleToWrite = new List<SerializedDomainRole>();			
	if(Children != null )
	{

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

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

        
        #line default
        #line hidden
        
        #line 1401 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance = element as ");

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

        
        #line default
        #line hidden
        
        #line 1401 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(";\r\n\t\tglobal::System.Diagnostics.Debug.Assert(instance != null, \"Expecting an inst" +
        "ance of ");

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

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

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

		propertiesToWriteInThisClass.Clear();
		foreach(SerializationElement child in Children )
		{
			if( child is SerializedDomainProperty )
			{
				SerializedDomainProperty sP = child as SerializedDomainProperty;
				DomainProperty p = sP.DomainProperty;
				
				if( sP.OmitProperty )
					continue;				
				
				if( sP.SerializationRepresentationType != SerializationRepresentationType.Element )
					continue;
				
				if( p.Element.GetMetaModel() == this.MetaModel && p.Element == domainClass)
					propertiesToWriteInThisClass.Add(sP);

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

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

        
        #line default
        #line hidden
        
        #line 1422 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, writer, options);\r\n");

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

			}
			else if( child is SerializedEmbeddingRelationship)
			{
				SerializedEmbeddingRelationship sCon = child as SerializedEmbeddingRelationship;
				EmbeddingRelationship con = sCon.EmbeddingRelationship;
			
				if( sCon.OmitRelationship )
					continue;
				
				if( con.GetMetaModel() == this.MetaModel && con.Source.RolePlayer == domainClass)
					embRelationshipsToWrite.Add(sCon);


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

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

        
        #line default
        #line hidden
        
        #line 1437 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, writer, options);\r\n");

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

			}
			else if( child is SerializedReferenceRelationship && !(domainClass is EmbeddingRelationship))
			{
				SerializedReferenceRelationship sCon = child as SerializedReferenceRelationship;
				ReferenceRelationship con = sCon.ReferenceRelationship;
			
				if( sCon.OmitRelationship )
					continue;
				
				if( con.GetMetaModel() == this.MetaModel && con.Source.RolePlayer == domainClass )
					refRelationshipsToWrite.Add(sCon);				

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

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

        
        #line default
        #line hidden
        
        #line 1451 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, writer, options);\r\n");

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

			}
			else if( child is SerializedDomainClass && domainClass is EmbeddingRelationship )
			{
				EmbeddingRelationship con = domainClass as EmbeddingRelationship;
				SerializedDomainClass dS = child as SerializedDomainClass;
				DomainClass d = dS.DomainClass;
				
				if( d.GetMetaModel() == this.MetaModel)
					embRelationshipsTargetToWrite.Add(dS);

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

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

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

        
        #line default
        #line hidden
        
        #line 1463 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, writer, options);\r\n");

        
        #line default
        #line hidden
        
        #line 1464 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
	
			}
			else if( child is SerializedDomainRole && domainClass is ReferenceRelationship )
			{
				SerializedDomainRole sRole = child as SerializedDomainRole;
				DomainRole role = sRole.DomainRole;
				ReferenceRelationship con = domainClass as ReferenceRelationship;
				
				if( role.RolePlayer.GetMetaModel() == this.MetaModel )
					refRelationshipsRoleToWrite.Add(sRole);				
				

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

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

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

        
        #line default
        #line hidden
        
        #line 1476 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext, instance, writer, options);\r\n");

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

			}
		}
	}

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

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

			foreach(SerializedDomainProperty sP in propertiesToWriteInThisClass)
			{
				DomainProperty p = sP.DomainProperty;
				
				string isReq = "false";
				if( p.IsRequired )
					isReq = "true";
				
				if( sP.SerializationRepresentationType != SerializationRepresentationType.Element )
					continue;
				
				string modifier ="virtual";
				if( CodeGenerationUtilities.HasProperty(domainClass.BaseElement, p.Name))
					modifier = "override";

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

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

        
        #line default
        #line hidden
        
        #line 1501 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that need to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=\"s" +
        "erializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instance\"" +
        ">");

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

        
        #line default
        #line hidden
        
        #line 1504 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param> 
	/// <param name=""options"">Serialization options.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected ");

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

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

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

        
        #line default
        #line hidden
        
        #line 1508 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 1508 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlWriter writer, DslEditorModeling::SerializationO" +
        "ptions options)\r\n\t{\r\n\t\tif (!serializationContext.Result.Failed)\r\n\t\t{\r\n\t\t\t// ");

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

        
        #line default
        #line hidden
        
        #line 1512 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n\t\t\tobject value");

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

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

        
        #line default
        #line hidden
        
        #line 1513 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Type.MetaModel.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1513 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertTypedObjectTo(serializationContext,instance, " +
        "\"");

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

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

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

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

        
        #line default
        #line hidden
        
        #line 1513 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetDomainTypeFullName(p)));

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

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

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

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

		if( String.IsNullOrEmpty(p.DefaultValue) )
		{

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

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

        
        #line default
        #line hidden
        
        #line 1519 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t\t{\r\n");

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

				if( p.Type.SerializationStyle == SerializationStyle.CDATA )
				{

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

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

        
        #line default
        #line hidden
        
        #line 1525 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteElementCDATAString(serializationContext, instan" +
        "ce, writer, \"");

        
        #line default
        #line hidden
        
        #line 1525 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

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

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

				}
				else
				{

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

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

        
        #line default
        #line hidden
        
        #line 1531 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteElementString(serializationContext, instance, w" +
        "riter, \"");

        
        #line default
        #line hidden
        
        #line 1531 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

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

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

				}

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

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

		}
		else
		{

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

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

        
        #line default
        #line hidden
        
        #line 1541 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" != null )\r\n\t\t\t{\r\n");

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

				if( p.Type.SerializationStyle == SerializationStyle.CDATA )
				{

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

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

        
        #line default
        #line hidden
        
        #line 1547 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteElementCDATAString(serializationContext, instan" +
        "ce, writer, \"");

        
        #line default
        #line hidden
        
        #line 1547 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

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

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

				}
				else
				{

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

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

        
        #line default
        #line hidden
        
        #line 1553 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteElementString(serializationContext, instance, w" +
        "riter, \"");

        
        #line default
        #line hidden
        
        #line 1553 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

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

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

				}

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

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

				if( p.Type.SerializationStyle == SerializationStyle.CDATA )
				{

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

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

        
        #line default
        #line hidden
        
        #line 1564 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteElementCDATAString(serializationContext, instan" +
        "ce, writer, \"");

        
        #line default
        #line hidden
        
        #line 1564 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

				}
				else
				{

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

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

        
        #line default
        #line hidden
        
        #line 1570 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.WriteElementString(serializationContext, instance, w" +
        "riter, \"");

        
        #line default
        #line hidden
        
        #line 1570 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sP.SerializationName));

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

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

				}

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

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

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

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

			}
			
			foreach(SerializedEmbeddingRelationship sCon in embRelationshipsToWrite)
			{
				EmbeddingRelationship con = sCon.EmbeddingRelationship;
				string modifier = "virtual";
				if( CodeGenerationUtilities.HasRelationship(domainClass.BaseElement, con.Name))
					modifier = "override";				

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

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

        
        #line default
        #line hidden
        
        #line 1591 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that need to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=\"s" +
        "erializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instance\"" +
        ">");

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

        
        #line default
        #line hidden
        
        #line 1594 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param> 
	/// <param name=""options"">Serialization options.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected ");

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

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

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

        
        #line default
        #line hidden
        
        #line 1598 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

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

        
        #line default
        #line hidden
        
        #line 1598 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlWriter writer, DslEditorModeling::SerializationO" +
        "ptions options)\r\n\t{\r\n");

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

				if( sCon.IsTargetIncludedSubmodel )
				{
					DomainClass targetClass = con.Target.RolePlayer as DomainClass;

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

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

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 1605 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.PropertyName.TrimStart('@')));

        
        #line default
        #line hidden
        
        #line 1605 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(instance);\r\n        if( allM");

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

        
        #line default
        #line hidden
        
        #line 1606 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"Instance != null )
		{
			DslEditorModeling::IParentModelElement parent = instance.GetDomainModelServices().ElementParentProvider.GetParentModelElement(instance);
            if (parent == null)
                throw new System.ArgumentNullException(""Parent of element "" + instance.ToString() + "" can not be null"");
			
			string path = parent.DomainFilePath;
            string vModellDirectory = new System.IO.FileInfo(path).DirectoryName;
            
			// get current path
            string curPath = (allM");

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

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

        
        #line default
        #line hidden
        
        #line 1616 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

        
        #line default
        #line hidden
        
        #line 1616 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" as DslEditorModeling::IParentModelElement).DomainFilePath;

            // update v-modell path
            string relPath = Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions.Path.PathHelper.EvaluateRelativePath(
                vModellDirectory, curPath);

            // remove all DirectorySeparatorChars on the left, so we dont get a path like ////name/name.xml
            while(relPath.Length > 0 )
            {
                if (relPath[0] == System.IO.Path.DirectorySeparatorChar)
                    relPath = relPath.Remove(0, 1);
                else
                    break;
            }
			
			writer.WriteStartElement(""xi"", ""include"", null);
            writer.WriteAttributeString(""href"", relPath);
            writer.WriteEndElement();

            if (options.SerializationMode == DslEditorModeling::SerializationMode.Normal)
            {
                // save
                ");

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

        
        #line default
        #line hidden
        
        #line 1638 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.SaveModel");

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

        
        #line default
        #line hidden
        
        #line 1638 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(serializationContext.Result, allM");

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

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

        
        #line default
        #line hidden
        
        #line 1638 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

        
        #line default
        #line hidden
        
        #line 1638 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(", curPath, writer.Settings.Encoding, false);\r\n            }\t\t\t\r\n\t\t}\r\n");

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

				}
				else
				{

        
        #line default
        #line hidden
        
        #line 1645 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\r\n\t\t#region Save EmbeddingRelationship ");

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

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

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

				bool bSerializeInFullForm = con.NeedsFullSerialization() || sCon.IsInFullSerialization;
				if( con.Source.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.ZeroMany || con.Source.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.OneMany )
				{

        
        #line default
        #line hidden
        
        #line 1651 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tglobal::System.Collections.ObjectModel.ReadOnlyCollection<");

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

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 1652 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.PropertyName.TrimStart('@')));

        
        #line default
        #line hidden
        
        #line 1652 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(instance);\r\n\t\tforeach(");

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

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

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

        
        #line default
        #line hidden
        
        #line 1653 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instance in allM");

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

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

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

				}
				else
				{

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

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

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

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

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

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

        
        #line default
        #line hidden
        
        #line 1660 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".GetLinkTo");

        
        #line default
        #line hidden
        
        #line 1660 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.PropertyName.TrimStart('@')));

        
        #line default
        #line hidden
        
        #line 1660 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(instance);\r\n\t\tif( allM");

        
        #line default
        #line hidden
        
        #line 1661 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1661 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instance != null )\r\n\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 1663 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				}

        
        #line default
        #line hidden
        
        #line 1665 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\tif (!serializationContext.Result.Failed)\r\n\t\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 1668 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				if (bSerializeInFullForm)
				{

        
        #line default
        #line hidden
        
        #line 1671 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\t// Relationship will be serialized in full-form.\r\n\t\t\t\tDslModeling::ModelEleme" +
        "nt targetElement = allM");

        
        #line default
        #line hidden
        
        #line 1673 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1673 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"Instance;
				DslEditorModeling::SerializationDomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id) as DslEditorModeling::SerializationDomainClassXmlSerializer;
				global::System.Diagnostics.Debug.Assert(targetSerializer != null, ""Cannot find serializer for "" + targetElement.GetDomainClass().Name + ""!"");			
				targetSerializer.Write(serializationContext, targetElement, writer, options);
");

        
        #line default
        #line hidden
        
        #line 1677 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				}
				else
				{

        
        #line default
        #line hidden
        
        #line 1681 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\t// No need to serialize the relationship itself, just serialize the role-play" +
        "er directly.\r\n\t\t\t\tDslModeling::ModelElement targetElement = allM");

        
        #line default
        #line hidden
        
        #line 1683 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1683 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instance.");

        
        #line default
        #line hidden
        
        #line 1683 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

        
        #line default
        #line hidden
        
        #line 1683 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@";
				DslEditorModeling::SerializationDomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id) as DslEditorModeling::SerializationDomainClassXmlSerializer;
				global::System.Diagnostics.Debug.Assert(targetSerializer != null, ""Cannot find serializer for "" + targetElement.GetDomainClass().Name + ""!"");			
				targetSerializer.Write(serializationContext, targetElement, writer, options);
");

        
        #line default
        #line hidden
        
        #line 1687 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				}

        
        #line default
        #line hidden
        
        #line 1689 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t}\r\n\t\t}\r\n\t\t#endregion\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 1693 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				}

        
        #line default
        #line hidden
        
        #line 1695 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t}\r\n");

        
        #line default
        #line hidden
        
        #line 1697 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

			}
			
			foreach(SerializedReferenceRelationship sCon in refRelationshipsToWrite)
			{
				ReferenceRelationship con = sCon.ReferenceRelationship;
				string modifier = "virtual";
				if( CodeGenerationUtilities.HasRelationship(domainClass.BaseElement, con.Name))
					modifier = "override";	

        
        #line default
        #line hidden
        
        #line 1706 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t/// <summary>\r\n\t/// Write ref. rel ");

        
        #line default
        #line hidden
        
        #line 1708 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1708 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that need to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=\"s" +
        "erializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instance\"" +
        ">");

        
        #line default
        #line hidden
        
        #line 1711 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.Name));

        
        #line default
        #line hidden
        
        #line 1711 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param> 
	/// <param name=""options"">Serialization options.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected ");

        
        #line default
        #line hidden
        
        #line 1715 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(modifier));

        
        #line default
        #line hidden
        
        #line 1715 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" void WriteReferenceRelationship");

        
        #line default
        #line hidden
        
        #line 1715 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1715 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

        
        #line default
        #line hidden
        
        #line 1715 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1715 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlWriter writer, DslEditorModeling::SerializationO" +
        "ptions options)\r\n\t{\r\n\t\t#region Save ReferenceRelationship ");

        
        #line default
        #line hidden
        
        #line 1717 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1717 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n");

        
        #line default
        #line hidden
        
        #line 1718 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
				
				bool bSerializeInFullForm = con.NeedsFullSerialization() || sCon.IsInFullSerialization;
				if( con.Source.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.ZeroMany || con.Source.Multiplicity == Tum.PDE.LanguageDSL.Multiplicity.OneMany )
				{

        
        #line default
        #line hidden
        
        #line 1722 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\tglobal::System.Collections.ObjectModel.ReadOnlyCollection<");

        
        #line default
        #line hidden
        
        #line 1723 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1723 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("> allM");

        
        #line default
        #line hidden
        
        #line 1723 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1723 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instances = ");

        
        #line default
        #line hidden
        
        #line 1723 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1723 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".GetLinksTo");

        
        #line default
        #line hidden
        
        #line 1723 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.PropertyName.TrimStart('@')));

        
        #line default
        #line hidden
        
        #line 1723 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(instance);\r\n\t\tforeach(");

        
        #line default
        #line hidden
        
        #line 1724 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1724 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" allM");

        
        #line default
        #line hidden
        
        #line 1724 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1724 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instance in allM");

        
        #line default
        #line hidden
        
        #line 1724 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1724 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instances)\r\n\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 1726 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				}
				else
				{

        
        #line default
        #line hidden
        
        #line 1730 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t");

        
        #line default
        #line hidden
        
        #line 1731 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1731 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" allM");

        
        #line default
        #line hidden
        
        #line 1731 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1731 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instance = ");

        
        #line default
        #line hidden
        
        #line 1731 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1731 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".GetLinkTo");

        
        #line default
        #line hidden
        
        #line 1731 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Source.PropertyName.TrimStart('@')));

        
        #line default
        #line hidden
        
        #line 1731 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(instance);\r\n\t\tif( allM");

        
        #line default
        #line hidden
        
        #line 1732 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1732 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instance != null )\r\n\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 1734 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				}

        
        #line default
        #line hidden
        
        #line 1736 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\tif (!serializationContext.Result.Failed)\r\n\t\t\t{\r\n");

        
        #line default
        #line hidden
        
        #line 1739 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				if( bSerializeInFullForm )
				{

        
        #line default
        #line hidden
        
        #line 1742 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\t// Full serialization mode\r\n\t\t\t\tDslModeling::ModelElement targetElement = all" +
        "M");

        
        #line default
        #line hidden
        
        #line 1744 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1744 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@"Instance;
				DslEditorModeling::SerializationDomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id) as DslEditorModeling::SerializationDomainClassXmlSerializer;
				global::System.Diagnostics.Debug.Assert(targetSerializer != null, ""Cannot find serializer for "" + targetElement.GetDomainClass().Name + ""!"");			
				targetSerializer.Write(serializationContext, targetElement, writer, options);
");

        
        #line default
        #line hidden
        
        #line 1748 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				}
				else
				{

        
        #line default
        #line hidden
        
        #line 1752 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t\t// Write target link\r\n\t\t\t\twriter.WriteStartElement(\"");

        
        #line default
        #line hidden
        
        #line 1754 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.SerializationTargetName));

        
        #line default
        #line hidden
        
        #line 1754 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\");\r\n\t\t\t\tstring valueId = ");

        
        #line default
        #line hidden
        
        #line 1755 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.MetaModel.Name));

        
        #line default
        #line hidden
        
        #line 1755 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertIdTo(serializationContext, (allM");

        
        #line default
        #line hidden
        
        #line 1755 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1755 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("Instance ).");

        
        #line default
        #line hidden
        
        #line 1755 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Target.Name));

        
        #line default
        #line hidden
        
        #line 1755 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".Id);\r\n\t\t\t\twriter.WriteAttributeString(\"");

        
        #line default
        #line hidden
        
        #line 1756 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.SerializationAttributeName));

        
        #line default
        #line hidden
        
        #line 1756 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\", valueId);\r\n\t\t\t\twriter.WriteEndElement();\r\n");

        
        #line default
        #line hidden
        
        #line 1758 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

				}

        
        #line default
        #line hidden
        
        #line 1760 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\t\t}\r\n\t\t}\r\n\t\t#endregion\t\r\n\t}\r\n");

        
        #line default
        #line hidden
        
        #line 1765 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

			}
			
			foreach(SerializedDomainClass dS in embRelationshipsTargetToWrite)
			{
				EmbeddingRelationship con = domainClass as EmbeddingRelationship;
				DomainClass d = dS.DomainClass;

        
        #line default
        #line hidden
        
        #line 1772 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t/// <summary>\r\n\t/// Write emb. rel ");

        
        #line default
        #line hidden
        
        #line 1774 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1774 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" target ");

        
        #line default
        #line hidden
        
        #line 1774 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.Name));

        
        #line default
        #line hidden
        
        #line 1774 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that need to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=\"s" +
        "erializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instance\"" +
        ">");

        
        #line default
        #line hidden
        
        #line 1777 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.Name));

        
        #line default
        #line hidden
        
        #line 1777 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param> 
	/// <param name=""options"">Serialization options.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected virtual void WriteEmbeddingRelationshipTarget");

        
        #line default
        #line hidden
        
        #line 1781 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1781 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.Name));

        
        #line default
        #line hidden
        
        #line 1781 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

        
        #line default
        #line hidden
        
        #line 1781 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1781 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlWriter writer, DslEditorModeling::SerializationO" +
        "ptions options)\r\n\t{\r\n\t\t#region Save EmbeddingRelationship Target Element (");

        
        #line default
        #line hidden
        
        #line 1783 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.Name));

        
        #line default
        #line hidden
        
        #line 1783 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(")\r\n\t\tif (!serializationContext.Result.Failed)\r\n\t\t{\r\n\t\t\t");

        
        #line default
        #line hidden
        
        #line 1786 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1786 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" rs = instance;\r\n\t\t\t\r\n\t\t\t// Write target link\r\n\t\t\t//DslModeling::ModelElement tar" +
        "getElement = rs.");

        
        #line default
        #line hidden
        
        #line 1789 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(d.Name));

        
        #line default
        #line hidden
        
        #line 1789 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@";
			DslModeling::ModelElement targetElement = DslModeling::DomainRoleInfo.GetTargetRolePlayer(rs);
			DslEditorModeling::SerializationDomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id) as DslEditorModeling::SerializationDomainClassXmlSerializer;
			global::System.Diagnostics.Debug.Assert(targetSerializer != null, ""Cannot find serializer for "" + targetElement.GetDomainClass().Name + ""!"");			
			targetSerializer.Write(serializationContext, targetElement, writer, options);
		}
		#endregion		
	}
");

        
        #line default
        #line hidden
        
        #line 1797 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

			}
			
			foreach(SerializedDomainRole sRole in refRelationshipsRoleToWrite)
			{
				DomainRole role = sRole.DomainRole;
				ReferenceRelationship con = domainClass as ReferenceRelationship;				

        
        #line default
        #line hidden
        
        #line 1804 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t/// <summary>\r\n\t/// Write ref. rel ");

        
        #line default
        #line hidden
        
        #line 1806 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1806 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" role ");

        
        #line default
        #line hidden
        
        #line 1806 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Name));

        
        #line default
        #line hidden
        
        #line 1806 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" that need to be serialized as XML element.\r\n\t/// </summary>\r\n\t/// <param name=\"s" +
        "erializationContext\">Serialization context.</param>\r\n\t/// <param name=\"instance\"" +
        ">");

        
        #line default
        #line hidden
        
        #line 1809 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.Name));

        
        #line default
        #line hidden
        
        #line 1809 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(@" instance to be serialized.</param>
	/// <param name=""writer"">XmlWriter to write serialized data to.</param> 
	/// <param name=""options"">Serialization options.</param>
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Maintainability"", ""CA1502:AvoidExcessiveComplexity"", Justification = ""Generated code."")]
	protected virtual void WriteReferenceRelationshipRole");

        
        #line default
        #line hidden
        
        #line 1813 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(con.Name));

        
        #line default
        #line hidden
        
        #line 1813 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Name));

        
        #line default
        #line hidden
        
        #line 1813 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("(DslModeling::SerializationContext serializationContext, ");

        
        #line default
        #line hidden
        
        #line 1813 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetFullName(true)));

        
        #line default
        #line hidden
        
        #line 1813 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" instance, global::System.Xml.XmlWriter writer, DslEditorModeling::SerializationO" +
        "ptions options)\r\n\t{\r\n\t\t#region Save ReferenceRelationship ");

        
        #line default
        #line hidden
        
        #line 1815 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.Name));

        
        #line default
        #line hidden
        
        #line 1815 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" Roles\r\n\t\tif (!serializationContext.Result.Failed)\r\n\t\t{\r\n\t\t\t// Write ");

        
        #line default
        #line hidden
        
        #line 1818 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Name));

        
        #line default
        #line hidden
        
        #line 1818 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" link id\r\n\t\t\twriter.WriteStartElement(\"");

        
        #line default
        #line hidden
        
        #line 1819 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sRole.SerializationName));

        
        #line default
        #line hidden
        
        #line 1819 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\");\r\n\t\t\tstring valueId = ");

        
        #line default
        #line hidden
        
        #line 1820 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.MetaModel.Name));

        
        #line default
        #line hidden
        
        #line 1820 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("SerializationHelper.Instance.ConvertIdTo(serializationContext, instance.");

        
        #line default
        #line hidden
        
        #line 1820 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(role.Name));

        
        #line default
        #line hidden
        
        #line 1820 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".Id);\r\n\t\t\twriter.WriteAttributeString(\"");

        
        #line default
        #line hidden
        
        #line 1821 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(sRole.SerializationAttributeName));

        
        #line default
        #line hidden
        
        #line 1821 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\", valueId);\r\n\t\t\twriter.WriteEndElement();\r\n\t\t}\r\n\t\t#endregion\t\t\r\n\t}\r\n");

        
        #line default
        #line hidden
        
        #line 1826 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

			}

        
        #line default
        #line hidden
        
        #line 1828 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\t\r\n\t\r\n\t#endregion\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 1832 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
 
	if (domainClass.GeneratesDoubleDerived)
	{

        
        #line default
        #line hidden
        
        #line 1835 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n/// <summary>\r\n/// Serializer ");

        
        #line default
        #line hidden
        
        #line 1838 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(serializerClassName));

        
        #line default
        #line hidden
        
        #line 1838 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" for DomainClass ");

        
        #line default
        #line hidden
        
        #line 1838 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.GetRelativeName(namespaceString, false)));

        
        #line default
        #line hidden
        
        #line 1838 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(".\r\n/// </summary>\r\n");

        
        #line default
        #line hidden
        
        #line 1840 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

		if (inheritanceDepth > 5)
		{

        
        #line default
        #line hidden
        
        #line 1843 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("[global::System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Maintainabili" +
        "ty\", \"CA1501:AvoidExcessiveInheritance\", Justification = \"Generated code.\")]\r\n");

        
        #line default
        #line hidden
        
        #line 1845 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

		}

        
        #line default
        #line hidden
        
        #line 1848 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(CodeGenerationUtilities.GetAccessModifier(domainClass.AccessModifier)));

        
        #line default
        #line hidden
        
        #line 1848 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(domainClass.InheritanceModifier == InheritanceModifier.Sealed ? " sealed" : string.Empty));

        
        #line default
        #line hidden
        
        #line 1848 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" partial class ");

        
        #line default
        #line hidden
        
        #line 1848 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(serializerClassName));

        
        #line default
        #line hidden
        
        #line 1848 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" : ");

        
        #line default
        #line hidden
        
        #line 1848 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(serializerGenerationClassName));

        
        #line default
        #line hidden
        
        #line 1848 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("\r\n{\r\n\t#region Constructor\r\n\t/// <summary>\r\n\t/// ");

        
        #line default
        #line hidden
        
        #line 1852 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(serializerClassName));

        
        #line default
        #line hidden
        
        #line 1852 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" Constructor\r\n\t/// </summary>\r\n\tpublic ");

        
        #line default
        #line hidden
        
        #line 1854 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(serializerClassName));

        
        #line default
        #line hidden
        
        #line 1854 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write(" ()\r\n\t\t: base ()\r\n\t{\r\n\t}\r\n\t#endregion\r\n}\r\n");

        
        #line default
        #line hidden
        
        #line 1860 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

	}	

        
        #line default
        #line hidden
        
        #line 1864 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
	
	PopIndent();

        
        #line default
        #line hidden
        
        #line 1866 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"
this.Write("}\r\n");

        
        #line default
        #line hidden
        
        #line 1868 "J:\Uni\CC Processes\Werkzeuge\PDE 2\Tum.PDE.ToolFramework\Tum.PDE.ToolFramework.Templates\DomainClassSerializer.tt"

	return this.MetaModel.Name + domainClass.Name + "Serializer";
}