Share via


DomainClassXmlSerializer.TryCreateMonikerInstance Method

Checks if the given XmlReader is pointing to a monikerized instance of a model element that this serializer can handle.

Namespace:  Microsoft.VisualStudio.Modeling
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.11.0 (in Microsoft.VisualStudio.Modeling.Sdk.11.0.dll)

Syntax

'Declaration
Public Overridable Function TryCreateMonikerInstance ( _
    serializationContext As SerializationContext, _
    reader As XmlReader, _
    sourceRolePlayer As ModelElement, _
    relDomainClassId As Guid, _
    partition As Partition _
) As Moniker
public virtual Moniker TryCreateMonikerInstance(
    SerializationContext serializationContext,
    XmlReader reader,
    ModelElement sourceRolePlayer,
    Guid relDomainClassId,
    Partition partition
)
public:
virtual Moniker^ TryCreateMonikerInstance(
    SerializationContext^ serializationContext, 
    XmlReader^ reader, 
    ModelElement^ sourceRolePlayer, 
    Guid relDomainClassId, 
    Partition^ partition
)
abstract TryCreateMonikerInstance : 
        serializationContext:SerializationContext * 
        reader:XmlReader * 
        sourceRolePlayer:ModelElement * 
        relDomainClassId:Guid * 
        partition:Partition -> Moniker  
override TryCreateMonikerInstance : 
        serializationContext:SerializationContext * 
        reader:XmlReader * 
        sourceRolePlayer:ModelElement * 
        relDomainClassId:Guid * 
        partition:Partition -> Moniker
public function TryCreateMonikerInstance(
    serializationContext : SerializationContext, 
    reader : XmlReader, 
    sourceRolePlayer : ModelElement, 
    relDomainClassId : Guid, 
    partition : Partition
) : Moniker

Parameters

  • reader
    Type: XmlReader

    The XmlReader from which to read.

  • relDomainClassId
    Type: Guid

    The domain class Id of the relationship that connects the source role player to the moniker being created.

Return Value

Type: Microsoft.VisualStudio.Modeling.Moniker
If the XmlReader is currently pointing to a monikerized instance of a model element that this serializer can handle, this method creates a Moniker instance in the given Store. Otherwise, returns null.

Remarks

Note

The caller will guarantee that the reader is positioned at the open XML tag of the element moniker being read. This method will move the reader, unlike the TryCreateInstance method, because it might need 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.

.NET Framework Security

See Also

Reference

DomainClassXmlSerializer Class

Microsoft.VisualStudio.Modeling Namespace