DesignerSerializer.TryCreateInstance(SerializationContext, XmlReader, Partition) 方法

定義

這個方法會根據讀取器目前指向的標記,建立正確的設計工具實例。This method creates a correct instance of Designer based on the tag currently pointed by the reader. 如果讀取器位於序列化設計工具,則會在指定的資料分割中建立新的設計工具實例,否則會傳回 null。If the reader is positioned at a serialized Designer, a new Designer instance will be created in the given partition, otherwise null is returned.

public:
 override Microsoft::VisualStudio::Modeling::ModelElement ^ TryCreateInstance(Microsoft::VisualStudio::Modeling::SerializationContext ^ serializationContext, System::Xml::XmlReader ^ reader, Microsoft::VisualStudio::Modeling::Partition ^ partition);
public override Microsoft.VisualStudio.Modeling.ModelElement TryCreateInstance (Microsoft.VisualStudio.Modeling.SerializationContext serializationContext, System.Xml.XmlReader reader, Microsoft.VisualStudio.Modeling.Partition partition);
override this.TryCreateInstance : Microsoft.VisualStudio.Modeling.SerializationContext * System.Xml.XmlReader * Microsoft.VisualStudio.Modeling.Partition -> Microsoft.VisualStudio.Modeling.ModelElement
Public Overrides Function TryCreateInstance (serializationContext As SerializationContext, reader As XmlReader, partition As Partition) As ModelElement

參數

serializationContext
SerializationContext

序列化內容。Serialization context.

reader
XmlReader

要從中讀取序列化資料的 XmlReader。XmlReader to read serialized data from.

partition
Partition

應該在其中建立新專案的資料分割。Partition in which new elements should be created.

傳回

ModelElement

建立的設計工具實例,如果讀取器未指向序列化設計工具實例,則為 null。Created Designer instance, or null if the reader is not pointing to a serialized Designer 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.

適用於