VCFileCodeModel VCFileCodeModel VCFileCodeModel Interface

Definition

An object representing the code elements in a source file.

[System.Runtime.InteropServices.Guid("2970BD39-ABC0-4A65-9CB2-981201B46648")]
[System.Runtime.InteropServices.TypeLibType(System.Runtime.InteropServices.TypeLibTypeFlags.FDual | System.Runtime.InteropServices.TypeLibTypeFlags.FDispatchable)]
public interface VCFileCodeModel : EnvDTE80.FileCodeModel2
type VCFileCodeModel = interface
    interface FileCodeModel2
Public Interface VCFileCodeModel
Implements FileCodeModel2
Attributes
Implements

Examples

This example retrieves the VCFileCodeModel for the first project item of the current solution. It assumes a default MFC project is open.

Sub GetSourceFile()  
    Dim vcFile as VCFileCodeModel  
    Dim project as Project  
    project = DTE.Solution.Item(1)  
    vcFile = project.ProjectItems.Item(1).FileCodeModel  
End Sub  

Remarks

The VCFileCodeModel object is used to modify an existing source file and the code elements contained within.

Note

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

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

Properties

Attributes Attributes Attributes

Gets a collection of all of the attributes for the object.

Classes Classes Classes

Gets a collection of classes for the object.

CodeElements CodeElements CodeElements

Gets a collection of code elements.

Delegates Delegates Delegates

Gets a collection of delegates for the object.

DTE DTE DTE

Gets the top-level extensibility object.

EndPoint EndPoint EndPoint

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

Enums Enums Enums

Gets a collection of enumerations for the object.

Functions Functions Functions

Gets a collection of functions for the object.

IDLImports IDLImports IDLImports

Gets the collection of Import statements from the .idl file of the object.

IDLLibraries IDLLibraries IDLLibraries

Gets the collection of Library elements on the object.

Imports Imports Imports

Gets the collection of #import statements for the object.

Includes Includes Includes

Gets the collection of #include statements for the object.

Interfaces Interfaces Interfaces

Gets the collection of interfaces for the object.

IsBatchOpen IsBatchOpen IsBatchOpen

Not currently implemented.

IsManaged IsManaged IsManaged

Gets true if the ref keyword is used.

IsMCOldSyntax IsMCOldSyntax IsMCOldSyntax

Gets a value indicating whether the file was compiled using the old syntax.

IsSynchronized IsSynchronized IsSynchronized

Not implemented.

Language Language Language

Gets the programming language used to author the code.

Macros Macros Macros

Gets the collection of macros (#define statements) for the object.

Maps Maps Maps

Gets the collection of maps for the object.

Namespaces Namespaces Namespaces

Gets the collection of namespaces for the object.

Parent Parent Parent

Gets the immediate parent object of a given object.

ParseStatus ParseStatus ParseStatus

Gets an enumeration defining the outcome of parsing the file for the code model.

StartPoint StartPoint StartPoint

Gets a TextPoint object that defines the beginning of the code item.

Structs Structs Structs

Gets the collection of structure elements for the object.

Typedefs Typedefs Typedefs

Gets the collection of typedef elements for the object.

Unions Unions Unions

Gets the collection of union elements for the object.

UsingAliases UsingAliases UsingAliases
Usings Usings Usings

Gets the collection of #using elements for the object.

Variables Variables Variables

Gets the collection of variables for the object.

Methods

AbortTransaction() AbortTransaction() AbortTransaction()

Halts the current transaction.

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

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

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

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

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

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

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

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

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

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

AddIDLImport(String, Object) AddIDLImport(String, Object) AddIDLImport(String, Object)

Adds a new import statement to the .idl file of the VCFileCodeModel object.

AddIDLLibrary(String, Object) AddIDLLibrary(String, Object) AddIDLLibrary(String, Object)

Adds a new library statement to the .idl file of the VCFileCodeModel object.

AddImport(String, Object, String) AddImport(String, Object, String) AddImport(String, Object, String)

Adds a #import element to the VCFileCodeModel object.

AddImport_2(String, Object, String) AddImport_2(String, Object, String) AddImport_2(String, Object, String)

Adds a #import element to the VCFileCodeModel object.

AddInclude(String, Object) AddInclude(String, Object) AddInclude(String, Object)

Adds a #include element to the VCFileCodeModel object.

AddInterface(String, Object, Object, vsCMAccess) AddInterface(String, Object, Object, vsCMAccess) AddInterface(String, Object, Object, vsCMAccess)

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

AddMacro(String, String, Object) AddMacro(String, String, Object) AddMacro(String, String, Object)

Adds a #define element to the VCFileCodeModel object.

AddMap(String, String, Object) AddMap(String, String, Object) AddMap(String, String, Object)

Adds a map to the object.

AddNamespace(String, Object) AddNamespace(String, Object) AddNamespace(String, Object)

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

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

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

AddTypedef(String, Object, Object, vsCMAccess) AddTypedef(String, Object, Object, vsCMAccess) AddTypedef(String, Object, Object, vsCMAccess)

Adds a typedef statement to the object.

AddUnion(String, Object, vsCMAccess) AddUnion(String, Object, vsCMAccess) AddUnion(String, Object, vsCMAccess)

Adds a union statement to the object.

AddUsing(String, Object) AddUsing(String, Object) AddUsing(String, Object)

Adds a #using element to the VCFileCodeModel object.

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

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

BeginBatch() BeginBatch() BeginBatch()

Not currently implemented.

CodeElementFromFullName(String) CodeElementFromFullName(String) CodeElementFromFullName(String)

Gets a collection of the specified code elements for the object.

CodeElementFromPoint(TextPoint, vsCMElement) CodeElementFromPoint(TextPoint, vsCMElement) CodeElementFromPoint(TextPoint, vsCMElement)

Gets a code element at a specific location in a source file.

CommitTransaction() CommitTransaction() CommitTransaction()

Commits the current transaction for the object.

ElementFromID(String) ElementFromID(String) ElementFromID(String)

Not currently implemented.

EndBatch() EndBatch() EndBatch()

Not currently implemented.

Remove(Object) Remove(Object) Remove(Object)

Removes the specified project from the solution.

RemoveEx(Object, Int32) RemoveEx(Object, Int32) RemoveEx(Object, Int32)

Removes the specified project from the solution with an option to delete.

StartTransaction(String) StartTransaction(String) StartTransaction(String)

Begins a transaction.

Synchronize() Synchronize() Synchronize()

Synchronizes all code model objects in the solution with edits made to source files.

ValidateMember(String, vsCMElement, String) ValidateMember(String, vsCMElement, String) ValidateMember(String, vsCMElement, String)

Validates that the proposed name is a valid C++ name for the kind given in the context of the parent object.

ValidateMemberName(String, vsCMElement, vcCMNameValidationOption) ValidateMemberName(String, vsCMElement, vcCMNameValidationOption) ValidateMemberName(String, vsCMElement, vcCMNameValidationOption)

Applies to