編輯

共用方式為


PropertyDataCollection.Add Method

Definition

Adds a new PropertyData object.

Overloads

Add(String, Object)

Adds a new PropertyData with the specified value. The value cannot be null and must be convertible to a Common Information Model (CIM) type.

Add(String, CimType, Boolean)

Adds a new PropertyData with no assigned value.

Add(String, Object, CimType)

Adds a new PropertyData with the specified value and Common Information Model (CIM) type.

Add(String, Object)

Source:
PropertySet.cs
Source:
PropertySet.cs
Source:
PropertySet.cs

Adds a new PropertyData with the specified value. The value cannot be null and must be convertible to a Common Information Model (CIM) type.

public:
 virtual void Add(System::String ^ propertyName, System::Object ^ propertyValue);
public virtual void Add (string propertyName, object propertyValue);
abstract member Add : string * obj -> unit
override this.Add : string * obj -> unit
Public Overridable Sub Add (propertyName As String, propertyValue As Object)

Parameters

propertyName
String

The name of the new property.

propertyValue
Object

The value of the property (cannot be null).

Remarks

Properties can only be added to class definitions, not to instances. This method is only valid when invoked on a PropertyDataCollection in a ManagementClass.

.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.

Applies to

Add(String, CimType, Boolean)

Source:
PropertySet.cs
Source:
PropertySet.cs
Source:
PropertySet.cs

Adds a new PropertyData with no assigned value.

public:
 void Add(System::String ^ propertyName, System::Management::CimType propertyType, bool isArray);
public void Add (string propertyName, System.Management.CimType propertyType, bool isArray);
member this.Add : string * System.Management.CimType * bool -> unit
Public Sub Add (propertyName As String, propertyType As CimType, isArray As Boolean)

Parameters

propertyName
String

The name of the property.

propertyType
CimType

The Common Information Model (CIM) type of the property.

isArray
Boolean

true to specify that the property is an array type; otherwise, false.

Remarks

Properties can only be added to class definitions, not to instances. This method is only valid when invoked on a PropertyDataCollection in a ManagementClass.

.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.

Applies to

Add(String, Object, CimType)

Source:
PropertySet.cs
Source:
PropertySet.cs
Source:
PropertySet.cs

Adds a new PropertyData with the specified value and Common Information Model (CIM) type.

public:
 void Add(System::String ^ propertyName, System::Object ^ propertyValue, System::Management::CimType propertyType);
public void Add (string propertyName, object propertyValue, System.Management.CimType propertyType);
member this.Add : string * obj * System.Management.CimType -> unit
Public Sub Add (propertyName As String, propertyValue As Object, propertyType As CimType)

Parameters

propertyName
String

The name of the property.

propertyValue
Object

The value of the property (which can be null).

propertyType
CimType

The CIM type of the property.

Remarks

Properties can only be added to class definitions, not to instances. This method is only valid when invoked on a PropertyDataCollection in a ManagementClass.

.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.

Applies to