DomainClassXmlSerializer::TryCreateMonikerInstance Method (SerializationContext^, XmlReader^, ModelElement^, Guid, Partition^)
Checks if the given XmlReader is pointing to a monikerized instance of a model element that this serializer can handle.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.12.0.dll)
public: virtual Moniker^ TryCreateMonikerInstance( SerializationContext^ serializationContext, XmlReader^ reader, ModelElement^ sourceRolePlayer, Guid relDomainClassId, Partition^ partition )
Parameters
- serializationContext
-
Type:
Microsoft.VisualStudio.Modeling::SerializationContext^
The serialization context that stores serialization errors, if any.
- reader
-
Type:
System.Xml::XmlReader^
The XmlReader from which to read.
- sourceRolePlayer
-
Type:
Microsoft.VisualStudio.Modeling::ModelElement^
The source role-player model element from which the moniker being created is referenced.
- relDomainClassId
-
Type:
System::Guid
The domain class Id of the relationship that connects the source role player to the moniker being created.
- partition
-
Type:
Microsoft.VisualStudio.Modeling::Partition^
The new Moniker should be created in the store associated with this partition.
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.
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. |
