PortSerializer.TryCreateMonikerInstance(SerializationContext, XmlReader, ModelElement, Guid, Partition) 方法

定义

此方法根据读取器当前所指的标记,创建正确的派生 (的标记,包括端口本身) 端口实例。This method creates a Moniker of the correct derived (including Port itself) instance of Port based on the tag currently pointed by the reader.

public:
 override 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 override 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);
override this.TryCreateMonikerInstance : Microsoft.VisualStudio.Modeling.SerializationContext * System.Xml.XmlReader * Microsoft.VisualStudio.Modeling.ModelElement * Guid * Microsoft.VisualStudio.Modeling.Partition -> Microsoft.VisualStudio.Modeling.Moniker
Public Overrides Function TryCreateMonikerInstance (serializationContext As SerializationContext, reader As XmlReader, sourceRolePlayer As ModelElement, relDomainClassId As Guid, partition As Partition) As Moniker

参数

serializationContext
SerializationContext

序列化上下文。Serialization context.

reader
XmlReader

要从中读取序列化数据的 XmlReader。XmlReader to read serialized data from.

sourceRolePlayer
ModelElement

要从中创建名字对象的源角色扮演者实例。The source role-player instance from which the moniker being created is referenced.

relDomainClassId
Guid

将 sourceRolePlayer 连接到正在创建的名字对象的关系的 DomainClass Id。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.

返回

Moniker

创建的 ModelRoot 实例,如果读取器未指向正确的 monikerized 实例,则为 null。Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.

注解

调用方将保证读取器位于要读取的下一个元素的 open XML 标记处。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.

适用于