Compartir a través de


CodeVariable2.ConstKind Property

Sets or gets when the variable is eligible to be changed.

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

Syntax

'Declaration
Property ConstKind As vsCMConstKind
vsCMConstKind ConstKind { get; set; }
property vsCMConstKind ConstKind {
    vsCMConstKind get ();
    void set (vsCMConstKind value);
}
abstract ConstKind : vsCMConstKind with get, set
function get ConstKind () : vsCMConstKind 
function set ConstKind (value : vsCMConstKind)

Property Value

Type: EnvDTE80.vsCMConstKind
A vsCMConstKind enumeration.

Remarks

Values are defined by the vsCmConstKind enumeration.

The ConstKind property is used to determine whether a property has been designated as a constant or read-only variable. It can be used in conjunction with the IsConstant property, but it can also be used independently.

Setting the ConstKind property has a direct effect on the current CodeElement. (It is not required to also change the IsConstant property.) Therefore, ConstKind can be used to create a new const or read-only variable or to convert an existing variable from any of the three states to any other. The IsConstant property will be updated to match.)

Note

The values of code model elements such as classes, structs, functions, attributes, delegates, and so forth can be non-deterministic after making certain kinds of edits, meaning that their values cannot be relied upon to always remain the same. For more information, see the section Code Model Element Values Can Change in Discovering Code by Using the Code Model (Visual Basic).

.NET Framework Security

See Also

Reference

CodeVariable2 Interface

EnvDTE80 Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples

Discovering Code by Using the Code Model (Visual Basic)

Discovering Code by Using the Code Model (Visual C#)