Поделиться через


Property.Value Property

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

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

Syntax

'Declaration
Default Property Value As Object
Object this { get; set; }
property Object^ default {
    Object^ get ();
    void set (Object^ value);
}
abstract Value : Object with get, set
function get Value () : Object
function set Value (value : Object)

Property Value

Type: System.Object
An object.

Remarks

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.

Examples

' Visual Studio macro.
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

.NET Framework Security

See Also

Reference

Property Interface

EnvDTE Namespace