src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/SerializationHelper.cs
/// <summary>
/// Write an element as the root of XML.
/// </summary>
/// <param name="serializationContext">Serialization context.</param>
/// <param name="rootElement">Root element instance that will be serialized.</param>
/// <param name="writer">XmlWriter to write serialized data to.</param>
Write an element as the root of XML.
Write an element as the root of XML .
public virtual void WriteRootElement(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement rootElement, global::System.Xml.XmlWriter writer)
		{
			#region Check Parameters
			global::System.Diagnostics.Debug.Assert(serializationContext != null);
			if (serializationContext == null)
				throw new global::System.ArgumentNullException("serializationContext");
			global::System.Diagnostics.Debug.Assert(rootElement != null);
			if (rootElement == null)
				throw new global::System.ArgumentNullException("rootElement");
			global::System.Diagnostics.Debug.Assert(writer != null);
			if (writer == null)
				throw new global::System.ArgumentNullException("writer");
			#endregion
			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(rootElement.Store);
			DslModeling::DomainClassXmlSerializer rootSerializer = directory.GetSerializer(rootElement.GetDomainClass().Id);
			global::System.Diagnostics.Debug.Assert(rootSerializer != null, "Cannot find serializer for " + rootElement.GetDomainClass().Name + "!");
			DslModeling::RootElementSettings rootElementSettings = new DslModeling::RootElementSettings();
			if (!(rootElement is DslDiagrams::Diagram))
			{
				rootElementSettings.SchemaTargetNamespace = "http://schemas.microsoft.com/dsltools/MicrosoftDataEntityDesign";
			}
			rootElementSettings.Version = new global::System.Version("1.0.0.0");
			rootSerializer.Write(serializationContext, rootElement, writer, rootElementSettings);
		}
public virtual void WriteRootElement ( DslModeling :: SerializationContext serializationContext , DslModeling :: ModelElement rootElement , global :: System . Xml . XmlWriter writer ) { region  Check Parameters global :: System . Diagnostics . Debug . Assert ( serializationContext != null ) ; if ( serializationContext == null ) throw new global :: System . ArgumentNullException ( " " ) ; global :: System . Diagnostics . Debug . Assert ( rootElement != null ) ; if ( rootElement == null ) throw new global :: System . ArgumentNullException ( " " ) ; global :: System . Diagnostics . Debug . Assert ( writer != null ) ; if ( writer == null ) throw new global :: System . ArgumentNullException ( " " ) ; endregion DslModeling :: DomainXmlSerializerDirectory directory = this . GetDirectory ( rootElement . Store ) ; DslModeling :: DomainClassXmlSerializer rootSerializer = directory . GetSerializer ( rootElement . GetDomainClass ( ) . Id ) ; global :: System . Diagnostics . Debug . Assert ( rootSerializer != null , " " + rootElement . GetDomainClass ( ) . Name + " " ) ; DslModeling :: RootElementSettings rootElementSettings = new DslModeling :: RootElementSettings ( ) ; if ( ! ( rootElement is DslDiagrams :: Diagram ) ) { rootElementSettings . SchemaTargetNamespace = " " ; } rootElementSettings . Version = new global :: System . Version ( " " ) ; rootSerializer . Write ( serializationContext , rootElement , writer , rootElementSettings ) ; }
Write an element as the root of XML.
Write an element as the root of XML .
// Set up root element settings // Only model has schema, diagram has no schema. // Carry out the normal serialization.
serializationContext
DslModeling::SerializationContext
None
rootElement
DslModeling::ModelElement
Root element instance that will be serialized.
Root element instance that will be serialized .
writer
global::System.Xml.XmlWriter
XmlWriter to write serialized data to.
XmlWriter to write serialized data to .