PropertyCollection.AddProperty Method
Adds a new property to the collection.
Namespace: Microsoft.VisualStudio.Utilities
Assembly: Microsoft.VisualStudio.CoreUtility (in Microsoft.VisualStudio.CoreUtility.dll)
Syntax
'Declaração
Public Sub AddProperty ( _
key As Object, _
property As Object _
)
public void AddProperty(
Object key,
Object property
)
public:
void AddProperty(
Object^ key,
Object^ property
)
member AddProperty :
key:Object *
property:Object -> unit
public function AddProperty(
key : Object,
property : Object
)
Parameters
- key
Type: System.Object
The key by which the property can be retrieved. Must be non-nulla null reference (Nothing in Visual Basic).
- property
Type: System.Object
The property to associate with the key.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | key is nulla null reference (Nothing in Visual Basic). |
ArgumentException | An element with the same key already exists in the collection. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.