src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/Serializer.cs
/// <summary>
/// Public Write() method that serializes one ScalarProperty instance into XML.
/// </summary>
/// <param name="serializationContext">Serialization context.</param>
/// <param name="element">ScalarProperty 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>
Public Write() method that serializes one ScalarProperty instance into XML.
Public Write () method that serializes one ScalarProperty instance into XML .
public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
		{
			#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
			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
			{
				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
			}
			else
			{
				writer.WriteStartElement(this.XmlTagName);
			}
			if (rootElementSettings != null && rootElementSettings.Version != null)
				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
			WritePropertiesAsAttributes(serializationContext, element, writer);
			if (!serializationContext.Result.Failed)
			{
				base.WriteElements(serializationContext, element, writer);
			}
			writer.WriteEndElement();
		}
public override void Write ( DslModeling :: SerializationContext serializationContext , DslModeling :: ModelElement element , global :: System . Xml . XmlWriter writer , DslModeling :: RootElementSettings rootElementSettings ) { region  Check Parameters global :: System . Diagnostics . Debug . Assert ( serializationContext != null ) ; if ( serializationContext == null ) throw new global :: System . ArgumentNullException ( " " ) ; global :: System . Diagnostics . Debug . Assert ( element != null ) ; if ( element == null ) throw new global :: System . ArgumentNullException ( " " ) ; global :: System . Diagnostics . Debug . Assert ( writer != null ) ; if ( writer == null ) throw new global :: System . ArgumentNullException ( " " ) ; endregion if ( rootElementSettings != null && ! string . IsNullOrEmpty ( rootElementSettings . SchemaTargetNamespace ) ) { writer . WriteStartElement ( this . XmlTagName , rootElementSettings . SchemaTargetNamespace ) ; DslModeling :: SerializationUtilities . WriteDomainModelNamespaces ( serializationContext . Directory , writer , rootElementSettings . SchemaTargetNamespace ) ; } else { writer . WriteStartElement ( this . XmlTagName ) ; } if ( rootElementSettings != null && rootElementSettings . Version != null ) writer . WriteAttributeString ( " " , rootElementSettings . Version . ToString ( 4 ) ) ; WritePropertiesAsAttributes ( serializationContext , element , writer ) ; if ( ! serializationContext . Result . Failed ) { base . WriteElements ( serializationContext , element , writer ) ; } writer . WriteEndElement ( ) ; }
Public Write() method that serializes one ScalarProperty instance into XML.
Public Write () method that serializes one ScalarProperty instance into XML .
// Write start of element, including schema target namespace if specified. // Write version info (in the format 1.2.3.4), if necessary // Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
serializationContext
DslModeling::SerializationContext
None
element
DslModeling::ModelElement
ScalarProperty instance to be serialized.
ScalarProperty instance to be serialized .
writer
global::System.Xml.XmlWriter
XmlWriter to write serialized data to.
XmlWriter to write serialized data to .
rootElementSettings
DslModeling::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).
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 ) .