src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/Serializer.cs
/// <summary>
/// This method creates a correct instance of NavigationProperty based on the tag currently pointed by the reader. If the reader
/// is positioned at a serialized NavigationProperty, a new NavigationProperty 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 NavigationProperty instance, or null if the reader is not pointing to a serialized NavigationProperty instance.</returns>
This method creates a correct instance of NavigationProperty based on the tag currently pointed by the reader. If the reader
is positioned at a serialized NavigationProperty, a new NavigationProperty instance will be created in the given partition, otherwise
null is returned.
This method creates a correct instance of NavigationProperty based on the tag currently pointed by the reader . If the reader is positioned at a serialized NavigationProperty a new NavigationProperty instance will be created in the given partition otherwise null is returned .
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
			DslModeling::ModelElement result = null;
			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
			{
				string localName = reader.LocalName;
				if (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)
					{	
						NavigationPropertySerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as NavigationPropertySerializer;
						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
					}
				}
			}
			return result;
		}
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 ( " " ) ; global :: System . Diagnostics . Debug . Assert ( reader != null ) ; if ( reader == null ) throw new global :: System . ArgumentNullException ( " " ) ; global :: System . Diagnostics . Debug . Assert ( partition != null ) ; if ( partition == null ) throw new global :: System . ArgumentNullException ( " " ) ; endregion DslModeling :: ModelElement result = null ; if ( ! serializationContext . Result . Failed && ! reader . EOF && reader . NodeType == global :: System . Xml . XmlNodeType . Element ) { string localName = reader . LocalName ; if ( 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 ) { NavigationPropertySerializer derivedSerializer = serializationContext . Directory . GetSerializer ( derivedClass . Id ) as NavigationPropertySerializer ; global :: System . Diagnostics . Debug . Assert ( derivedSerializer != null , " " + derivedClass . Name + " " ) ; result = derivedSerializer . CreateInstance ( serializationContext , reader , partition ) ; } } } return result ; }
This method creates a correct instance of NavigationProperty based on the tag currently pointed by the reader.
This method creates a correct instance of NavigationProperty based on the tag currently pointed by the reader .
// New "NavigationProperty" instance. // Check for derived classes of "NavigationProperty". // New derived class instance.
Created NavigationProperty instance, or null if the reader is not pointing to a serialized NavigationProperty instance.
Created NavigationProperty instance or null if the reader is not pointing to a serialized NavigationProperty 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 .
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.
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 .