Freigeben über


GraphPropertyCollection.AddNewProperty-Methode (String, Type)

Registriert eine neue GraphProperty mit dem Standardmetadatenersteller.

Namespace:  Microsoft.VisualStudio.GraphModel
Assembly:  Microsoft.VisualStudio.GraphModel (in Microsoft.VisualStudio.GraphModel.dll)

Syntax

'Declaration
Public Function AddNewProperty ( _
    id As String, _
    dataType As Type _
) As GraphProperty
public GraphProperty AddNewProperty(
    string id,
    Type dataType
)
public:
GraphProperty^ AddNewProperty(
    String^ id, 
    Type^ dataType
)
member AddNewProperty : 
        id:string * 
        dataType:Type -> GraphProperty
public function AddNewProperty(
    id : String, 
    dataType : Type
) : GraphProperty

Parameter

  • id
    Typ: String

    Eindeutige ID dieser GraphProperty

  • dataType
    Typ: Type

    Der Typ der Daten, die dieser GraphProperty zugeordnet sind.

Rückgabewert

Typ: Microsoft.VisualStudio.GraphModel.GraphProperty
Das neu registrierte GraphProperty-Objekt

Ausnahmen

Ausnahme Bedingung
ArgumentNullException

wird ausgelöst, wenn id NULL ist.

- oder -

wird ausgelöst, wenn dataType null ist

InvalidOperationException

ausgelöst, wenn die ID eine leere Zeichenfolge ist.

.NET Framework-Sicherheit

Siehe auch

Referenz

GraphPropertyCollection Klasse

AddNewProperty-Überladung

Microsoft.VisualStudio.GraphModel-Namespace