Partager via


DomainClassXmlSerializer.TryCreateMonikerInstance Method

Definition

With the given XmlReader, check if it is currently pointing to a monikerized instance of a ModelElement that this serializer can handle. If so, create an Moniker instance in the given Store; otherwise return NULL. Note: The caller will guarantee that the reader is positioned at open XML tag of the element moniker being read. This method will move the reader (unlike TryCreateInstance() method) because it may needs to read the serialized moniker string. If the reader is moved, it should be positioned at the closing tag of the element (so that the caller can call SerializationUtilities.SkipToNextElement() to move to the next element).

public:
 virtual Microsoft::VisualStudio::Modeling::Moniker ^ TryCreateMonikerInstance(Microsoft::VisualStudio::Modeling::SerializationContext ^ serializationContext, System::Xml::XmlReader ^ reader, Microsoft::VisualStudio::Modeling::ModelElement ^ sourceRolePlayer, Guid relDomainClassId, Microsoft::VisualStudio::Modeling::Partition ^ partition);
public virtual Microsoft.VisualStudio.Modeling.Moniker TryCreateMonikerInstance (Microsoft.VisualStudio.Modeling.SerializationContext serializationContext, System.Xml.XmlReader reader, Microsoft.VisualStudio.Modeling.ModelElement sourceRolePlayer, Guid relDomainClassId, Microsoft.VisualStudio.Modeling.Partition partition);
abstract member TryCreateMonikerInstance : Microsoft.VisualStudio.Modeling.SerializationContext * System.Xml.XmlReader * Microsoft.VisualStudio.Modeling.ModelElement * Guid * Microsoft.VisualStudio.Modeling.Partition -> Microsoft.VisualStudio.Modeling.Moniker
override this.TryCreateMonikerInstance : Microsoft.VisualStudio.Modeling.SerializationContext * System.Xml.XmlReader * Microsoft.VisualStudio.Modeling.ModelElement * Guid * Microsoft.VisualStudio.Modeling.Partition -> Microsoft.VisualStudio.Modeling.Moniker
Public Overridable Function TryCreateMonikerInstance (serializationContext As SerializationContext, reader As XmlReader, sourceRolePlayer As ModelElement, relDomainClassId As Guid, partition As Partition) As Moniker

Parameters

serializationContext
SerializationContext

Serialization context.

reader
XmlReader

XmlReader to read serialized data from.

sourceRolePlayer
ModelElement

The source role-player ModelElement from which the moniker being created is referenced.

relDomainClassId
Guid

The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.

partition
Partition

The new Moniker should be created in the Store associated with this partition.

Returns

The created moniker, or null if the reader is not pointing to a correct monikerized instance.

Applies to