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 (in Microsoft.VisualStudio.Modeling.Sdk.dll)

Syntax

'Declaration
Public Overridable Function TryCreateMonikerInstance ( _
    serializationContext As SerializationContext, _
    reader As XmlReader, _
    sourceRolePlayer As ModelElement, _
    relDomainClassId As Guid, _
    partition As Partition _
) As Moniker
'Usage
Dim instance As DomainClassXmlSerializer 
Dim serializationContext As SerializationContext 
Dim reader As XmlReader 
Dim sourceRolePlayer As ModelElement 
Dim relDomainClassId As Guid 
Dim partition As Partition 
Dim returnValue As Moniker 

returnValue = instance.TryCreateMonikerInstance(serializationContext, _
    reader, sourceRolePlayer, relDomainClassId, _
    partition)
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
)
public function TryCreateMonikerInstance(
    serializationContext : SerializationContext, 
    reader : XmlReader, 
    sourceRolePlayer : ModelElement, 
    relDomainClassId : Guid, 
    partition : Partition
) : Moniker

Parameters

  • relDomainClassId
    Type: System.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 nulla null reference (Nothing in Visual Basic).

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

DomainClassXmlSerializer Members

Microsoft.VisualStudio.Modeling Namespace