PropertyDataCollection.Add 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
PropertyData添加新对象。
重载
| 名称 | 说明 |
|---|---|
| Add(String, Object) |
PropertyData使用指定的值添加新项。 该值不能为 null,并且必须可转换为通用信息模型 (CIM) 类型。 |
| Add(String, CimType, Boolean) |
添加没有分配值的新 PropertyData 项。 |
| Add(String, Object, CimType) |
PropertyData使用指定的值和通用信息模型(CIM)类型添加新项。 |
Add(String, Object)
- Source:
- PropertySet.cs
- Source:
- PropertySet.cs
- Source:
- PropertySet.cs
- Source:
- 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)。
注解
属性只能添加到类定义中,而不能添加到实例中。 此方法仅在对中PropertyDataCollection调用ManagementClass时有效。
.NET Framework 安全性
直接调用方完全信任。 此成员不能由部分受信任的代码使用。 有关详细信息,请参阅 使用部分受信任的代码的库。
适用于
Add(String, CimType, Boolean)
- Source:
- PropertySet.cs
- Source:
- PropertySet.cs
- Source:
- PropertySet.cs
- Source:
- 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
属性的 Common Information Model (CIM) 类型。
- isArray
- Boolean
true 如果指定属性是数组类型,则为 ;否则,为 false.
注解
属性只能添加到类定义中,而不能添加到实例中。 此方法仅在对中PropertyDataCollection调用ManagementClass时有效。
.NET Framework 安全性
直接调用方完全信任。 此成员不能由部分受信任的代码使用。 有关详细信息,请参阅 使用部分受信任的代码的库。
适用于
Add(String, Object, CimType)
- Source:
- PropertySet.cs
- Source:
- PropertySet.cs
- Source:
- PropertySet.cs
- Source:
- 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
属性的值(可以是 null)。
- propertyType
- CimType
属性的 CIM 类型。
注解
属性只能添加到类定义中,而不能添加到实例中。 此方法仅在对中PropertyDataCollection调用ManagementClass时有效。
.NET Framework 安全性
直接调用方完全信任。 此成员不能由部分受信任的代码使用。 有关详细信息,请参阅 使用部分受信任的代码的库。