Compartilhar via


CodeVariable2.ConstKind Property

Definition

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

public:
 property EnvDTE80::vsCMConstKind ConstKind { EnvDTE80::vsCMConstKind get(); void set(EnvDTE80::vsCMConstKind value); };
public:
 property EnvDTE80::vsCMConstKind ConstKind { EnvDTE80::vsCMConstKind get(); void set(EnvDTE80::vsCMConstKind value); };
[System.Runtime.InteropServices.DispId(200)]
public EnvDTE80.vsCMConstKind ConstKind { [System.Runtime.InteropServices.DispId(200)] get; [System.Runtime.InteropServices.DispId(200)] set; }
[<System.Runtime.InteropServices.DispId(200)>]
[<get: System.Runtime.InteropServices.DispId(200)>]
[<set: System.Runtime.InteropServices.DispId(200)>]
member this.ConstKind : EnvDTE80.vsCMConstKind with get, set
Public Property ConstKind As vsCMConstKind

Property Value

A vsCMConstKind enumeration.

Attributes

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.

Applies to