GraphPropertyCollection.AddNewProperty 方法

定义

重载

AddNewProperty(String, Type)

将新的 GraphProperty 注册到默认的元数据创建器。

AddNewProperty(String, Type, Func<GraphMetadata>)

注册新的 GraphProperty

AddNewProperty(String, Type)

将新的 GraphProperty 注册到默认的元数据创建器。

public:
 Microsoft::VisualStudio::GraphModel::GraphProperty ^ AddNewProperty(System::String ^ id, Type ^ dataType);
public Microsoft.VisualStudio.GraphModel.GraphProperty AddNewProperty (string id, Type dataType);
member this.AddNewProperty : string * Type -> Microsoft.VisualStudio.GraphModel.GraphProperty
Public Function AddNewProperty (id As String, dataType As Type) As GraphProperty

参数

id
String

GraphProperty 的唯一 Id

dataType
Type

与 GraphProperty 关联的数据的类型

返回

GraphProperty

新注册的 GraphProperty 对象

例外

如果 dataType 为 null,则引发

如果 id 为空字符串,则引发

适用于

AddNewProperty(String, Type, Func<GraphMetadata>)

注册新的 GraphProperty

public:
 Microsoft::VisualStudio::GraphModel::GraphProperty ^ AddNewProperty(System::String ^ id, Type ^ dataType, Func<Microsoft::VisualStudio::GraphModel::GraphMetadata ^> ^ callback);
public Microsoft.VisualStudio.GraphModel.GraphProperty AddNewProperty (string id, Type dataType, Func<Microsoft.VisualStudio.GraphModel.GraphMetadata> callback);
member this.AddNewProperty : string * Type * Func<Microsoft.VisualStudio.GraphModel.GraphMetadata> -> Microsoft.VisualStudio.GraphModel.GraphProperty
Public Function AddNewProperty (id As String, dataType As Type, callback As Func(Of GraphMetadata)) As GraphProperty

参数

id
String

GraphProperty 的唯一 Id

dataType
Type

与 GraphProperty 关联的数据的类型

callback
Func<GraphMetadata>

可以延迟创建此属性的元数据的回调

返回

GraphProperty

新注册的 GraphProperty 对象

例外

如果 dataType 为 null,则引发

如果 id 为空字符串,则引发

适用于