Property.Value 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置由对象返回的属性的值 Property 。
public:
property System::Object ^ default { System::Object ^ get(); void set(System::Object ^ value); };
public:
property Platform::Object ^ default { Platform::Object ^ get(); void set(Platform::Object ^ value); };
[System.Runtime.InteropServices.DispId(0)]
public object this { [System.Runtime.InteropServices.DispId(0)] get; [System.Runtime.InteropServices.DispId(0)] set; }
[<System.Runtime.InteropServices.DispId(0)>]
[<get: System.Runtime.InteropServices.DispId(0)>]
[<set: System.Runtime.InteropServices.DispId(0)>]
member this.Value : obj with get, set
Default Public Property Value As Object
属性值
一个对象。
- 属性
示例
Sub ValueExample()
Dim Props As Properties
Dim PropObj As [Property]
Dim NameValPair As String
Props = DTE.Properties("Environment", "General")
MsgBox("Tools – Options – Environment – General Properties Count _
= " & Props.Count())
For Each PropObj In Props
NameValPair = NameValPair & (PropObj.Name & "Value = " & _
PropObj.Value.ToString & microsoft.VisualBasic.ControlChars.CrLf)
Next
MsgBox(NameValPair)
End Sub
注解
Value属性确定对象的默认值 Property 。 因为这会返回一个对象,所以任何类型的属性都是可访问的。 对象作为对象类型返回,数组作为数组返回。 Property表示多个值的对象将通过返回这些值 IndexedValue[] ,并且返回值的数目 NumIndices 。 设置属性可根据 Value 值类型适当地工作。
如果对象表示的属性 Property 在设计时是可读/写的,则该 Value 属性是可读/写的。 如果该属性为只读,则尝试设置该属性将 Value 导致错误。 如果该属性是只写的,则尝试返回 Value 属性将导致错误。