PropertyDataCollection.Add 方法

定義

加入新的 PropertyData 物件。

多載

Add(String, Object)

加入具有指定值的新 PropertyData。 這個值不得為 null 而且必須可轉換為通用訊息模型 (CIM) 型別。

Add(String, CimType, Boolean)

加入不具有指派值的新 PropertyData

Add(String, Object, CimType)

加入具有指定值和通用訊息模型 (CIM) 型別的新 PropertyData

Add(String, Object)

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

加入具有指定值的新 PropertyData。 這個值不得為 null 而且必須可轉換為通用訊息模型 (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

該屬性的值 (不可以是 Null)。

備註

屬性只能新增至類別定義,而不能新增至 實例。 只有在 中ManagementClass於 上PropertyDataCollection叫用時,這個方法才有效。

.NET Framework 安全性

完全信任立即呼叫者。 這個成員無法供部分信任的程式碼使用。 如需詳細資訊,請參閱 使用部分信任程式代碼的連結庫

適用於

Add(String, CimType, Boolean)

來源:
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

備註

屬性只能新增至類別定義,而不能新增至 實例。 只有在 中ManagementClass於 上PropertyDataCollection叫用時,這個方法才有效。

.NET Framework 安全性

完全信任立即呼叫者。 這個成員無法供部分信任的程式碼使用。 如需詳細資訊,請參閱 使用部分信任程式代碼的連結庫

適用於

Add(String, Object, CimType)

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

加入具有指定值和通用訊息模型 (CIM) 型別的新 PropertyData

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

該屬性的值 (不可以是 Null)。

propertyType
CimType

屬性的 CIM 型別。

備註

屬性只能新增至類別定義,而不能新增至 實例。 只有在 中ManagementClass於 上PropertyDataCollection叫用時,這個方法才有效。

.NET Framework 安全性

完全信任立即呼叫者。 這個成員無法供部分信任的程式碼使用。 如需詳細資訊,請參閱 使用部分信任程式代碼的連結庫

適用於