C# Class Company.OrmLanguage.ReferenceSerializer

Serializer ReferenceSerializer for DomainClass Reference.
Inheritance: EntrySerializer
Show file Open project: thabart/SimpleOrm

Public Methods

Method Description
CalculateQualifiedName ( global::Microsoft.VisualStudio.Modeling directory, global::Microsoft.VisualStudio.Modeling element ) : string

This method calculates a moniker to a given Reference instance.

GetMonikerQualifier ( global::Microsoft.VisualStudio.Modeling directory, global::Microsoft.VisualStudio.Modeling element ) : string

A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method returns empty string.

Read ( global::Microsoft.VisualStudio.Modeling serializationContext, global::Microsoft.VisualStudio.Modeling element, global reader ) : void

Public Read() method that deserializes one Reference instance from XML.

When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag of the Reference 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).

ReferenceSerializer ( )

ReferenceSerializer Constructor

TryCreateInstance ( global::Microsoft.VisualStudio.Modeling serializationContext, global reader, global::Microsoft.VisualStudio.Modeling partition ) : DslModeling::ModelElement

This method creates a correct instance of Reference based on the tag currently pointed by the reader. If the reader is positioned at a serialized Reference, a new Reference instance will be created in the given partition, otherwise null is returned.

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.

TryCreateMonikerInstance ( global::Microsoft.VisualStudio.Modeling serializationContext, global reader, global::Microsoft.VisualStudio.Modeling sourceRolePlayer, global relDomainClassId, global::Microsoft.VisualStudio.Modeling partition ) : DslModeling::Moniker

This method creates a Moniker of the correct derived (including Reference itself) instance of Reference based on the tag currently pointed by the reader.

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.

Write ( global::Microsoft.VisualStudio.Modeling serializationContext, global::Microsoft.VisualStudio.Modeling element, global writer, global::Microsoft.VisualStudio.Modeling rootElementSettings ) : void

Public Write() method that serializes one Reference instance into XML.

WriteMoniker ( global::Microsoft.VisualStudio.Modeling serializationContext, global::Microsoft.VisualStudio.Modeling element, global writer, global::Microsoft.VisualStudio.Modeling sourceRolePlayer, global::Microsoft.VisualStudio.Modeling relSerializer ) : void

Public WriteMoniker() method that writes a monikerized Reference instance into XML.

Protected Methods

Method Description
CreateInstance ( global::Microsoft.VisualStudio.Modeling serializationContext, global reader, global::Microsoft.VisualStudio.Modeling partition ) : DslModeling::ModelElement

This method creates an instance of Reference based on the tag currently pointed by the reader. The reader is guaranteed (by the caller) to be pointed at a serialized instance of Reference.

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.

CreateMonikerInstance ( global::Microsoft.VisualStudio.Modeling serializationContext, global reader, global::Microsoft.VisualStudio.Modeling sourceRolePlayer, global relDomainClassId, global::Microsoft.VisualStudio.Modeling partition ) : DslModeling::Moniker

This method creates a Moniker of Reference based on the tag currently pointed by the reader.

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.

Method Details

CalculateQualifiedName() public method

This method calculates a moniker to a given Reference instance.
public CalculateQualifiedName ( global::Microsoft.VisualStudio.Modeling directory, global::Microsoft.VisualStudio.Modeling element ) : string
directory global::Microsoft.VisualStudio.Modeling Directory to look up serializer based on model element type.
element global::Microsoft.VisualStudio.Modeling Reference instance to calculate qualified name for.
return string

CreateInstance() protected method

This method creates an instance of Reference based on the tag currently pointed by the reader. The reader is guaranteed (by the caller) to be pointed at a serialized instance of Reference.
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.
protected CreateInstance ( global::Microsoft.VisualStudio.Modeling serializationContext, global reader, global::Microsoft.VisualStudio.Modeling partition ) : DslModeling::ModelElement
serializationContext global::Microsoft.VisualStudio.Modeling Serialization context.
reader global XmlReader to read serialized data from.
partition global::Microsoft.VisualStudio.Modeling Partition in which new Reference instance should be created.
return DslModeling::ModelElement

CreateMonikerInstance() protected method

This method creates a Moniker of Reference based on the tag currently pointed by the reader.
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.
protected CreateMonikerInstance ( global::Microsoft.VisualStudio.Modeling serializationContext, global reader, global::Microsoft.VisualStudio.Modeling sourceRolePlayer, global relDomainClassId, global::Microsoft.VisualStudio.Modeling partition ) : DslModeling::Moniker
serializationContext global::Microsoft.VisualStudio.Modeling Serialization context.
reader global XmlReader to read serialized data from.
sourceRolePlayer global::Microsoft.VisualStudio.Modeling The source role-player instance from which the moniker being created is referenced.
relDomainClassId global The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.
partition global::Microsoft.VisualStudio.Modeling The new Moniker should be created in the Store associated with this partition.
return DslModeling::Moniker

GetMonikerQualifier() public method

A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method returns empty string.
public GetMonikerQualifier ( global::Microsoft.VisualStudio.Modeling directory, global::Microsoft.VisualStudio.Modeling element ) : string
directory global::Microsoft.VisualStudio.Modeling Directory to look up serializer based on model element type.
element global::Microsoft.VisualStudio.Modeling Reference instance to get moniker qualifier from.
return string

Read() public method

Public Read() method that deserializes one Reference instance from XML.
When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag of the Reference 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).
public Read ( global::Microsoft.VisualStudio.Modeling serializationContext, global::Microsoft.VisualStudio.Modeling element, global reader ) : void
serializationContext global::Microsoft.VisualStudio.Modeling Serialization context.
element global::Microsoft.VisualStudio.Modeling In-memory Reference instance that will get the deserialized data.
reader global XmlReader to read serialized data from.
return void

ReferenceSerializer() public method

ReferenceSerializer Constructor
public ReferenceSerializer ( )

TryCreateInstance() public method

This method creates a correct instance of Reference based on the tag currently pointed by the reader. If the reader is positioned at a serialized Reference, a new Reference instance will be created in the given partition, otherwise null is returned.
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.
public TryCreateInstance ( global::Microsoft.VisualStudio.Modeling serializationContext, global reader, global::Microsoft.VisualStudio.Modeling partition ) : DslModeling::ModelElement
serializationContext global::Microsoft.VisualStudio.Modeling Serialization context.
reader global XmlReader to read serialized data from.
partition global::Microsoft.VisualStudio.Modeling Partition in which new elements should be created.
return DslModeling::ModelElement

TryCreateMonikerInstance() public method

This method creates a Moniker of the correct derived (including Reference itself) instance of Reference based on the tag currently pointed by the reader.
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.
public TryCreateMonikerInstance ( global::Microsoft.VisualStudio.Modeling serializationContext, global reader, global::Microsoft.VisualStudio.Modeling sourceRolePlayer, global relDomainClassId, global::Microsoft.VisualStudio.Modeling partition ) : DslModeling::Moniker
serializationContext global::Microsoft.VisualStudio.Modeling Serialization context.
reader global XmlReader to read serialized data from.
sourceRolePlayer global::Microsoft.VisualStudio.Modeling The source role-player instance from which the moniker being created is referenced.
relDomainClassId global The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.
partition global::Microsoft.VisualStudio.Modeling The new Moniker should be created in the Store associated with this partition.
return DslModeling::Moniker

Write() public method

Public Write() method that serializes one Reference instance into XML.
public Write ( global::Microsoft.VisualStudio.Modeling serializationContext, global::Microsoft.VisualStudio.Modeling element, global writer, global::Microsoft.VisualStudio.Modeling rootElementSettings ) : void
serializationContext global::Microsoft.VisualStudio.Modeling Serialization context.
element global::Microsoft.VisualStudio.Modeling Reference instance to be serialized.
writer global XmlWriter to write serialized data to.
rootElementSettings global::Microsoft.VisualStudio.Modeling /// 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). ///
return void

WriteMoniker() public method

Public WriteMoniker() method that writes a monikerized Reference instance into XML.
public WriteMoniker ( global::Microsoft.VisualStudio.Modeling serializationContext, global::Microsoft.VisualStudio.Modeling element, global writer, global::Microsoft.VisualStudio.Modeling sourceRolePlayer, global::Microsoft.VisualStudio.Modeling relSerializer ) : void
serializationContext global::Microsoft.VisualStudio.Modeling Serialization context.
element global::Microsoft.VisualStudio.Modeling Reference instance to be monikerized.
writer global XmlWriter to write serialized data to.
sourceRolePlayer global::Microsoft.VisualStudio.Modeling Source element that references the Reference instance being monikerized.
relSerializer global::Microsoft.VisualStudio.Modeling Serializer that handles the relationship connecting the source element to the Reference instance being monikerized.
return void