語言

PropertyDataCollection.Add 方法

定義

新增一個物件 PropertyData 。

多載

名稱 Description
Add(String, Object)

新增一個與指定值相同的新 PropertyData 值。 該值不能為空值,且必須可轉換為通用資訊模型(CIM)類型。

Add(String, CimType, Boolean)

新增一個 PropertyData 沒有指定值的新東西。

Add(String, Object, CimType)

新增 PropertyData 一個指定值與通用資訊模型(CIM)類型的新資料。

Add(String, Object)

來源:
PropertySet.cs
來源:
PropertySet.cs
來源:
PropertySet.cs
來源:
PropertySet.cs

新增一個與指定值相同的新 PropertyData 值。 該值不能為空值,且必須可轉換為通用資訊模型(CIM)類型。

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)

參數

propertyName
String

新房產的名字。

propertyValue
Object

屬性的值(不可能為零)。

備註

屬性只能加入類別定義,無法加入實例。 此方法僅在 a 中PropertyDataCollection被ManagementClass調用時有效。

.NET Framework 安全性

完全信任當下的來電者。 此成員無法被部分受信任的程式碼使用。 欲了解更多資訊,請參閱 「部分受信任程式碼的函式庫使用」。

適用於

Add(String, CimType, Boolean)

來源:
PropertySet.cs
來源:
PropertySet.cs
來源:
PropertySet.cs
來源:
PropertySet.cs

新增一個 PropertyData 沒有指定值的新東西。

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)

參數

propertyName
String

屬性的名稱。

propertyType
CimType

該物業的通用資訊模型(CIM)類型。

isArray
Boolean

true指定屬性為陣列型別;否則,。 false

備註

屬性只能加入類別定義,無法加入實例。 此方法僅在 a 中PropertyDataCollection被ManagementClass調用時有效。

.NET Framework 安全性

完全信任當下的來電者。 此成員無法被部分受信任的程式碼使用。 欲了解更多資訊,請參閱 「部分受信任程式碼的函式庫使用」。

適用於

Add(String, Object, CimType)

來源:
PropertySet.cs
來源:
PropertySet.cs
來源:
PropertySet.cs
來源:
PropertySet.cs

新增 PropertyData 一個指定值與通用資訊模型(CIM)類型的新資料。

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)

參數

propertyName
String

屬性的名稱。

propertyValue
Object

屬性的值(可以為零)。

propertyType
CimType

房產的CIM類型。

備註

屬性只能加入類別定義,無法加入實例。 此方法僅在 a 中PropertyDataCollection被ManagementClass調用時有效。

.NET Framework 安全性

完全信任當下的來電者。 此成員無法被部分受信任的程式碼使用。 欲了解更多資訊,請參閱 「部分受信任程式碼的函式庫使用」。

適用於