Property::Value Property

 

Gets or sets the value of the property returned by the Property object.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

property Object^ Value {
	Object^ get();
	void set(Object^ value);
}

Property Value

Type: System::Object^

An object.

The Value property determines the default value for the Property object. Because this returns an object, any type of property is accessible. Objects are returned as the object type, and arrays are returned as arrays. A Property object representing multiple values returns them through the IndexedValue, and the number of values is returned by the NumIndices. Setting the Value property works appropriately, depending on the value type.

If the property that the Property object represents is read/write at design time, then the Value property is read/write. If the property is read-only, attempting to set the Value property causes an error. If the property is write-only, attempting to return the Value property causes an error.

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
Return to top
Show: