CodeClass2 CodeClass2 CodeClass2 CodeClass2 CodeClass2 CodeClass2 Interface

Definition

Represents a class in source code.

public interface class CodeClass2 : EnvDTE::CodeClass
public interface class CodeClass2 : EnvDTE::CodeClass
__interface CodeClass2 : EnvDTE::CodeClass
[System.Runtime.InteropServices.Guid("295ADCD4-B052-49EE-934E-C6B36862A7C6")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface CodeClass2 : EnvDTE.CodeClass
type CodeClass2 = interface
    interface CodeClass
Public Interface CodeClass2
Implements CodeClass
Attributes
Implements

Examples

[Visual Basic]

Sub CodeClass2Example()  
    ' Iterates through the main class and  
    ' lists its parts.  
    Dim sel As TextSelection  
    Dim myClass1 As EnvDTE80.CodeClass2  
    Dim classPart As EnvDTE80.CodeClass2  
  
    sel = applicationObject.ActiveDocument.Selection  
    myClass1 = sel.ActivePoint.CodeElement _  
    (vsCMElement.vsCMElementClass)  
    If myClass1.ClassKind = _  
    vsCMClassKind.vsCMClassKindMainClass Then  
        For Each classPart In myClass1.Collection  
            MsgBox(classPart.Name)  
        Next  
    End If  
End Sub  

Remarks

With the introduction of blueprints and partial classes, there may be more than one CodeClass object per class that gets compiled. There is one instance of a CodeClass object for each class contained in a file. The CodeClass2 object can determine if it represents a partial or complete class, and whether it is implemented as an XML blueprint or as code. Edits or additions to the CodeClass2 object may only be written into this portion (and file) of the class.

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).

Properties

Access Access Access Access Access Access

Sets or gets the access attributes of this code class.

Attributes Attributes Attributes Attributes Attributes Attributes

Gets a collection of all of the attributes for the code class.

Bases Bases Bases Bases Bases Bases

Gets a collection of classes from which this code class derives.

Children Children Children Children Children Children

Gets a collection of objects contained within this code class.

ClassKind ClassKind ClassKind ClassKind ClassKind ClassKind

Microsoft Internal Use Only.

Collection Collection Collection Collection Collection Collection

Gets the collection contained within the code class.

Comment Comment Comment Comment Comment Comment

Sets or gets the comment associated with the code class.

DataTypeKind DataTypeKind DataTypeKind DataTypeKind DataTypeKind DataTypeKind

Sets of gets the relationship of this class with other classes.

DerivedTypes DerivedTypes DerivedTypes DerivedTypes DerivedTypes DerivedTypes

Gets a collection of objects derived from the code class. Not implemented in Visual C#.

DocComment DocComment DocComment DocComment DocComment DocComment

Gets or sets the document comment for the code class.

DTE DTE DTE DTE DTE DTE

Gets the top-level extensibility object.

EndPoint EndPoint EndPoint EndPoint EndPoint EndPoint

Gets the edit point that is the location of the end of the code class.

Extender[String] Extender[String] Extender[String] Extender[String] Extender[String] Extender[String]

Returns the requested Extender object if it is available for the code class. Not implemented in Visual C#.

ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID ExtenderCATID

Gets the Extender category ID (CATID) for the code class. Not implemented in Visual C#.

ExtenderNames ExtenderNames ExtenderNames ExtenderNames ExtenderNames ExtenderNames

Gets a list of available Extenders for the code class. Not implemented in Visual C#.

FullName FullName FullName FullName FullName FullName

Gets the full path and name of the file of the code class.

ImplementedInterfaces ImplementedInterfaces ImplementedInterfaces ImplementedInterfaces ImplementedInterfaces ImplementedInterfaces

Gets a collection of interfaces implemented by the code class.

InfoLocation InfoLocation InfoLocation InfoLocation InfoLocation InfoLocation

Gets the capabilities of the code model.

InheritanceKind InheritanceKind InheritanceKind InheritanceKind InheritanceKind InheritanceKind

Gets or sets a value indicating whether a class may be used to create a new class.

IsAbstract IsAbstract IsAbstract IsAbstract IsAbstract IsAbstract

Sets or gets whether or not the code class is declared as abstract.

IsCodeType IsCodeType IsCodeType IsCodeType IsCodeType IsCodeType

Gets a value indicating whether a CodeType object can be obtained from the code class.

IsDerivedFrom[String] IsDerivedFrom[String] IsDerivedFrom[String] IsDerivedFrom[String] IsDerivedFrom[String] IsDerivedFrom[String]

Gets a value indicating whether the code class has another code class as its base.

IsGeneric IsGeneric IsGeneric IsGeneric IsGeneric IsGeneric

Gets a value indicating whether the current class or struct is a generic.

IsShared IsShared IsShared IsShared IsShared IsShared

Gets or sets the shared (static) status of the class.

Kind Kind Kind Kind Kind Kind

Gets an enumeration indicating the type of class.

Language Language Language Language Language Language

Gets the programming language used to author the class.

Members Members Members Members Members Members

Gets a collection of code elements contained by the class.

Name Name Name Name Name Name

Sets or gets the name of the class.

Namespace Namespace Namespace Namespace Namespace Namespace

Gets a CodeNamespace object defining the parent namespace of the class.

Parent Parent Parent Parent Parent Parent

Gets the immediate parent object of the class.

PartialClasses PartialClasses PartialClasses PartialClasses PartialClasses PartialClasses

Microsoft Internal Use Only.

Parts Parts Parts Parts Parts Parts

Gets parts of a class.

ProjectItem ProjectItem ProjectItem ProjectItem ProjectItem ProjectItem

Gets the ProjectItem associated with the given object.

StartPoint StartPoint StartPoint StartPoint StartPoint StartPoint

Gets a TextPoint object that defines the beginning of the class.

Methods

AddAttribute(String, String, Object) AddAttribute(String, String, Object) AddAttribute(String, String, Object) AddAttribute(String, String, Object) AddAttribute(String, String, Object) AddAttribute(String, String, Object)

Creates a new attribute code construct and inserts the class in the correct location.

AddBase(Object, Object) AddBase(Object, Object) AddBase(Object, Object) AddBase(Object, Object) AddBase(Object, Object) AddBase(Object, Object)

Adds an item to the list of inherited objects.

AddClass(String, Object, Object, Object, vsCMAccess) AddClass(String, Object, Object, Object, vsCMAccess) AddClass(String, Object, Object, Object, vsCMAccess) AddClass(String, Object, Object, Object, vsCMAccess) AddClass(String, Object, Object, Object, vsCMAccess) AddClass(String, Object, Object, Object, vsCMAccess)

Creates a new class in the specified code class.

AddDelegate(String, Object, Object, vsCMAccess) AddDelegate(String, Object, Object, vsCMAccess) AddDelegate(String, Object, Object, vsCMAccess) AddDelegate(String, Object, Object, vsCMAccess) AddDelegate(String, Object, Object, vsCMAccess) AddDelegate(String, Object, Object, vsCMAccess)

Creates a new delegate in the specified class.

AddEnum(String, Object, Object, vsCMAccess) AddEnum(String, Object, Object, vsCMAccess) AddEnum(String, Object, Object, vsCMAccess) AddEnum(String, Object, Object, vsCMAccess) AddEnum(String, Object, Object, vsCMAccess) AddEnum(String, Object, Object, vsCMAccess)

Creates a new enumeration in the class.

AddEvent(String, String, Boolean, Object, vsCMAccess) AddEvent(String, String, Boolean, Object, vsCMAccess) AddEvent(String, String, Boolean, Object, vsCMAccess) AddEvent(String, String, Boolean, Object, vsCMAccess) AddEvent(String, String, Boolean, Object, vsCMAccess) AddEvent(String, String, Boolean, Object, vsCMAccess)

Adds a class event.

AddFunction(String, vsCMFunction, Object, Object, vsCMAccess, Object) AddFunction(String, vsCMFunction, Object, Object, vsCMAccess, Object) AddFunction(String, vsCMFunction, Object, Object, vsCMAccess, Object) AddFunction(String, vsCMFunction, Object, Object, vsCMAccess, Object) AddFunction(String, vsCMFunction, Object, Object, vsCMAccess, Object) AddFunction(String, vsCMFunction, Object, Object, vsCMAccess, Object)

Creates a new function in the class.

AddImplementedInterface(Object, Object) AddImplementedInterface(Object, Object) AddImplementedInterface(Object, Object) AddImplementedInterface(Object, Object) AddImplementedInterface(Object, Object) AddImplementedInterface(Object, Object)

Adds an interface to the list of inherited objects.

AddProperty(String, String, Object, Object, vsCMAccess, Object) AddProperty(String, String, Object, Object, vsCMAccess, Object) AddProperty(String, String, Object, Object, vsCMAccess, Object) AddProperty(String, String, Object, Object, vsCMAccess, Object) AddProperty(String, String, Object, Object, vsCMAccess, Object) AddProperty(String, String, Object, Object, vsCMAccess, Object)

Creates a new property construct in the class.

AddStruct(String, Object, Object, Object, vsCMAccess) AddStruct(String, Object, Object, Object, vsCMAccess) AddStruct(String, Object, Object, Object, vsCMAccess) AddStruct(String, Object, Object, Object, vsCMAccess) AddStruct(String, Object, Object, Object, vsCMAccess) AddStruct(String, Object, Object, Object, vsCMAccess)

Creates a new structure in the class.

AddVariable(String, Object, Object, vsCMAccess, Object) AddVariable(String, Object, Object, vsCMAccess, Object) AddVariable(String, Object, Object, vsCMAccess, Object) AddVariable(String, Object, Object, vsCMAccess, Object) AddVariable(String, Object, Object, vsCMAccess, Object) AddVariable(String, Object, Object, vsCMAccess, Object)

Creates a new variable in the class.

GetEndPoint(vsCMPart) GetEndPoint(vsCMPart) GetEndPoint(vsCMPart) GetEndPoint(vsCMPart) GetEndPoint(vsCMPart) GetEndPoint(vsCMPart)

Gets a TextPoint object that marks the end of the class.

GetStartPoint(vsCMPart) GetStartPoint(vsCMPart) GetStartPoint(vsCMPart) GetStartPoint(vsCMPart) GetStartPoint(vsCMPart) GetStartPoint(vsCMPart)

Gets a TextPoint object that defines the beginning of the class.

RemoveBase(Object) RemoveBase(Object) RemoveBase(Object) RemoveBase(Object) RemoveBase(Object) RemoveBase(Object)

Removes an object from the list of bases.

RemoveInterface(Object) RemoveInterface(Object) RemoveInterface(Object) RemoveInterface(Object) RemoveInterface(Object) RemoveInterface(Object)

Removes an interface from the list of implemented interfaces.

RemoveMember(Object) RemoveMember(Object) RemoveMember(Object) RemoveMember(Object) RemoveMember(Object) RemoveMember(Object)

Removes a member of the class.

Applies to