This documentation is archived and is not being maintained.

VCCodeProperty Interface

An object representing a property code element (declared with the __property keyword).

Namespace:  Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

public interface VCCodeProperty

The VCCodeProperty type exposes the following members.

Public propertyAccessDefines the access attributes of this item.
Public propertyAttributesGets a collection of all attributes for the object.
Public propertyChildrenGets a collection of objects contained within this code construct.
Public propertyCodeModelGets the VCCodeModel object for the project.
Public propertyCollectionReturns the collection containing the object supporting this property or contained within this code construct.
Public propertyCommentGets or sets the comment associated with the code element.
Public propertyDeclarationTextGets or sets the declaration of the object.
Public propertyDisplayNameGets or sets the name used in the user interface for this output group.
Public propertyDocCommentGets or sets the document comment for the current code model element.
Public propertyDTEGets the top-level extensibility object.
Public propertyEndPointGets the edit point that is the location of the end of the code item.
Public propertyEndPointOfReturns the end point of the object.
Public propertyExtenderReturns the requested Extender object if it is available for this object.
Public propertyExtenderCATIDReturns the Extender category ID (CATID) for the object.
Public propertyExtenderNamesReturns a list of available Extenders for the object.
Public propertyFileGets the file where this object is defined.
Public propertyFullNameGets the full path and name of the object's file.
Public propertyFunctionsGets a collection of functions for the parent object.
Public propertyGetterGets or sets an object defining the code to return a property.
Public propertyInfoLocationDescribes the capabilities of the code model.
Public propertyIsCaseSensitiveDetermines if a code element is case-sensitive.
Public propertyIsCodeTypeGets a value indicating whether a CodeType object can be obtained from this object.
Public propertyIsInjectedGets if a code element has been injected by an attribute or macro expansion.
Public propertyIsReadOnlyGets a value indicating whether the file containing the object is read-only.
Public propertyIsSharedSets or gets whether the IsShared flag is set on a property.
Public propertyIsTrivialGets or sets a value indicating whether the property is trivial.
Public propertyIsVirtualSets or gets whether the property is virtual.
Public propertyIsZombieDetermines if the object exists.
Public propertyKindReturns an enumeration indicating the type of object.
Public propertyLanguageGets the programming language used to author the code.
Public propertyLocationReturns the location of the object declaration.
Public propertyNameGets or sets the name of the object.
Public propertyNamespaceGets an object defining the namespace.
Public propertyParametersGets a collection of parameters for this item.
Public propertyParentGets the immediate parent object of a given object.
Public propertyPictureGets a picture automation object to be used as an icon in the user interface.
Public propertyProjectGets the Project object associated with the object.
Public propertyProjectItemGets the ProjectItem object associated with the given object.
Public propertyPrototypeReturns a string holding the stub definition of this object.
Public propertySetterGets or sets an object defining the code to set a property.
Public propertyStartPointGets a TextPoint object that defines the beginning of the code item.
Public propertyStartPointOfGets the start point of the object.
Public propertyTypeGets or sets an object representing the programmatic type.
Public propertyTypeStringGets or sets the type of object using a string representation of the type.

Public methodAddAttributeCreates a new attribute code construct and inserts the code in the correct location.
Public methodGetEndPointGets a TextPoint object that marks the end of the code element definition.
Public methodGetStartPointGets a TextPoint object that defines the beginning of the code element definition.
Public methodIsSelfDetermines if the specified code element is the same as another code element.

The VCCodeProperty object represents a property code element in a source file and allows access to information about that specific code element.


A large part of the functionality of this object is provided by the Visual Studio CodeProperty object. For more information, see CodeProperty object.

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

This example retrieves all properties of the first class and displays their names in a message box.

Sub GetProperties()
    Dim vcCM As VCCodeModel
    Dim vcClass As VCCodeClass
    Dim vcProperty as VCCodeProperty
    vcCM = DTE.Solution.Item(1).CodeModel
    vcClass = vcCM.Classes.Item(1)
    For Each vcProperty in vcClass.Properties
End Sub