PropertyDataCollection.Add 方法

定义

添加新的 PropertyData 对象。

重载

Add(String, Object)

添加新的、带有指定值的 PropertyData。 值不能为 null,并且必须能够转换为公共信息模型 (CIM) 类型。

Add(String, CimType, Boolean)

添加新的、没有赋值的 PropertyData

Add(String, Object, CimType)

添加一个具有指定值和公共信息模型 (CIM) 类型的新 PropertyData

Add(String, Object)

添加新的、带有指定值的 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)。

注解

属性只能添加到类定义,不能添加到实例。 仅当对 PropertyDataCollection 中的 ManagementClass调用时,此方法才有效。

.NET Framework 安全性

对直接调用方的完全信任。 此成员不能由部分信任的代码使用。 有关详细信息,请参阅 使用部分受信任的代码中的库

适用于

Add(String, CimType, Boolean)

添加新的、没有赋值的 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

注解

属性只能添加到类定义,不能添加到实例。 仅当对 PropertyDataCollection 中的 ManagementClass调用时,此方法才有效。

.NET Framework 安全性

对直接调用方的完全信任。 此成员不能由部分信任的代码使用。 有关详细信息,请参阅 使用部分受信任的代码中的库

适用于

Add(String, Object, CimType)

添加一个具有指定值和公共信息模型 (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 类型。

注解

属性只能添加到类定义,不能添加到实例。 仅当对 PropertyDataCollection 中的 ManagementClass调用时,此方法才有效。

.NET Framework 安全性

对直接调用方的完全信任。 此成员不能由部分信任的代码使用。 有关详细信息,请参阅 使用部分受信任的代码中的库

适用于