GraphPropertyCollection.AddNewProperty Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddNewProperty(String, Type) |
Registers a new GraphProperty with the default metadata creator. |
AddNewProperty(String, Type, Func<GraphMetadata>) |
Registers a new GraphProperty |
AddNewProperty(String, Type)
Registers a new GraphProperty with the default metadata creator.
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
Parameters
- id
- String
Unique Id of the GraphProperty
- dataType
- Type
The type for data associated with the GraphProperty
Returns
The newly registered GraphProperty object
Exceptions
thrown if dataType is null
thrown if id is empty string
Applies to
AddNewProperty(String, Type, Func<GraphMetadata>)
Registers a new 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
Parameters
- id
- String
Unique Id of the GraphProperty
- dataType
- Type
The type for data associated with the GraphProperty
- callback
- Func<GraphMetadata>
The callback that can lazily create the metadata for this property
Returns
The newly registered GraphProperty object
Exceptions
thrown if dataType is null
thrown if id is empty string