src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/Serializer.cs
/// <summary>
/// Internal helper method for TryCreateInstance() and TryCreateDerivedInstance().
/// </summary>
/// <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>
/// <param name="derivedTypesOnly">If true, this method will only check derived types, but not the domain class iitself.</param>
Internal helper method for TryCreateInstance() and TryCreateDerivedInstance().
Internal helper method for TryCreateInstance () and TryCreateDerivedInstance () .
private DslModeling::ModelElement InternalTryCreateInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition, bool derivedTypesOnly)
		{
			DslModeling::ModelElement result = null;
			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
			{
				string localName = reader.LocalName;
				if (!derivedTypesOnly && string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
				{	
					result = this.CreateInstance(serializationContext, reader, partition);
				}
				else
				{	
					if (this.derivedClasses == null)
						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
					DslModeling::DomainClassInfo derivedClass = null;
					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
					{	
						InheritanceSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as InheritanceSerializer;
						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
					}
				}
			}
			return result;
		}
private DslModeling :: ModelElement InternalTryCreateInstance ( DslModeling :: SerializationContext serializationContext , global :: System . Xml . XmlReader reader , DslModeling :: Partition partition , bool derivedTypesOnly ) { DslModeling :: ModelElement result = null ; if ( ! serializationContext . Result . Failed && ! reader . EOF && reader . NodeType == global :: System . Xml . XmlNodeType . Element ) { string localName = reader . LocalName ; if ( ! derivedTypesOnly && string . Compare ( localName , this . XmlTagName , global :: System . StringComparison . CurrentCulture ) == 0 ) { result = this . CreateInstance ( serializationContext , reader , partition ) ; } else { if ( this . derivedClasses == null ) this . ConstructDerivedClassesLookupTable ( serializationContext , partition . DomainDataDirectory ) ; global :: System . Diagnostics . Debug . Assert ( this . derivedClasses != null ) ; DslModeling :: DomainClassInfo derivedClass = null ; if ( this . derivedClasses . TryGetValue ( localName , out derivedClass ) && derivedClass != null ) { InheritanceSerializer derivedSerializer = serializationContext . Directory . GetSerializer ( derivedClass . Id ) as InheritanceSerializer ; global :: System . Diagnostics . Debug . Assert ( derivedSerializer != null , " " + derivedClass . Name + " " ) ; result = derivedSerializer . CreateInstance ( serializationContext , reader , partition ) ; } } } return result ; }
Internal helper method for TryCreateInstance() and TryCreateDerivedInstance().
Internal helper method for TryCreateInstance () and TryCreateDerivedInstance () .
// New "Inheritance" instance. // Check for derived classes of "Inheritance". // New derived relationship instance.
serializationContext
DslModeling::SerializationContext
None
reader
global::System.Xml.XmlReader
XmlReader to read serialized data from.
XmlReader to read serialized data from .
partition
DslModeling::Partition
Partition in which new elements should be created.
Partition in which new elements should be created .
derivedTypesOnly
bool
If true, this method will only check derived types, but not the domain class iitself.
If true this method will only check derived types but not the domain class iitself .