VCFileCodeModel Interface
An object representing the code elements in a source file.
Namespace: Microsoft.VisualStudio.VCCodeModel
Assembly: Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)
Syntax
'Declaration
<GuidAttribute("DE3653F8-737D-4BDC-A340-6BA8DDDC0FA8")> _
Public Interface VCFileCodeModel _
Inherits FileCodeModel2
[GuidAttribute("DE3653F8-737D-4BDC-A340-6BA8DDDC0FA8")]
public interface VCFileCodeModel : FileCodeModel2
[GuidAttribute(L"DE3653F8-737D-4BDC-A340-6BA8DDDC0FA8")]
public interface class VCFileCodeModel : FileCodeModel2
[<GuidAttribute("DE3653F8-737D-4BDC-A340-6BA8DDDC0FA8")>]
type VCFileCodeModel =
interface
interface FileCodeModel2
end
public interface VCFileCodeModel extends FileCodeModel2
The VCFileCodeModel type exposes the following members.
Properties
Name | Description | |
---|---|---|
Attributes | Gets a collection of all of the attributes for the object. | |
Classes | Gets a collection of classes for the object. | |
CodeElements | (Inherited from FileCodeModel2.) | |
CodeElements | Gets a collection of code elements. | |
Delegates | Gets a collection of delegates for the object. | |
DTE | (Inherited from FileCodeModel2.) | |
DTE | Gets the top-level extensibility object. | |
EndPoint | Gets the edit point that is the location of the end of the code item. | |
Enums | Gets a collection of enumerations for the object. | |
Functions | Gets a collection of functions for the object. | |
IDLImports | Gets the collection of Import statements from the .idl file of the object. | |
IDLLibraries | Gets the collection of Library elements on the object. | |
Imports | Gets the collection of #import statements for the object. | |
Includes | Gets the collection of #include statements for the object. | |
Interfaces | Gets the collection of interfaces for the object. | |
IsBatchOpen | (Inherited from FileCodeModel2.) | |
IsBatchOpen | Not currently implemented. | |
IsManaged | Gets true if the ref keyword is used. | |
IsMCOldSyntax | Gets a value indicating whether the file was compiled using the old syntax. | |
IsSynchronized | Not implemented. | |
Language | (Inherited from FileCodeModel2.) | |
Language | Gets the programming language used to author the code. | |
Macros | Gets the collection of macros (#define statements) for the object. | |
Maps | Gets the collection of maps for the object. | |
Namespaces | Gets the collection of namespaces for the object. | |
Parent | (Inherited from FileCodeModel2.) | |
Parent | Gets the immediate parent object of a given object. | |
ParseStatus | (Inherited from FileCodeModel2.) | |
ParseStatus | Gets an enumeration defining the outcome of parsing the file for the code model. | |
StartPoint | Gets a TextPoint object that defines the beginning of the code item. | |
Structs | Gets the collection of structure elements for the object. | |
Typedefs | Gets the collection of typedef elements for the object. | |
Unions | Gets the collection of union elements for the object. | |
Usings | Gets the collection of #using elements for the object. | |
Variables | Gets the collection of variables for the object. |
Top
Methods
Name | Description | |
---|---|---|
AbortTransaction | Halts the current transaction. | |
AddAttribute(String, String, Object) | (Inherited from FileCodeModel2.) | |
AddAttribute(String, String, Object) | Creates a new attribute code construct and inserts the code in the correct location. | |
AddClass(String, Object, Object, Object, vsCMAccess) | (Inherited from FileCodeModel2.) | |
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) | (Inherited from FileCodeModel2.) | |
AddDelegate(String, Object, Object, vsCMAccess) | Creates a new delegate code construct and inserts the code in the correct location. | |
AddEnum(String, Object, Object, vsCMAccess) | (Inherited from FileCodeModel2.) | |
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) | (Inherited from FileCodeModel2.) | |
AddFunction(String, vsCMFunction, Object, Object, vsCMAccess) | Creates a new function code construct and inserts the code in the correct location. | |
AddIDLImport | Adds a new import statement to the .idl file of the VCFileCodeModel object. | |
AddIDLLibrary | Adds a new library statement to the .idl file of the VCFileCodeModel object. | |
AddImport(String, Object, String) | (Inherited from FileCodeModel2.) | |
AddImport(String, Object, String) | Adds a #import element to the VCFileCodeModel object. | |
AddImport_2 | Adds a #import element to the VCFileCodeModel object. | |
AddInclude | Adds a #include element to the VCFileCodeModel object. | |
AddInterface(String, Object, Object, vsCMAccess) | (Inherited from FileCodeModel2.) | |
AddInterface(String, Object, Object, vsCMAccess) | Creates a new interface code construct and inserts the code in the correct location. | |
AddMacro | Adds a #define element to the VCFileCodeModel object. | |
AddMap | Adds a map to the object. | |
AddNamespace(String, Object) | (Inherited from FileCodeModel2.) | |
AddNamespace(String, Object) | Creates a new namespace code construct and inserts the code in the correct location. | |
AddStruct(String, Object, Object, Object, vsCMAccess) | (Inherited from FileCodeModel2.) | |
AddStruct(String, Object, Object, Object, vsCMAccess) | Creates a new structure code construct and inserts the code in the correct location. | |
AddTypedef | Adds a typedef statement to the object. | |
AddUnion | Adds a union statement to the object. | |
AddUsing | Adds a #using element to the VCFileCodeModel object. | |
AddVariable(String, Object, Object, vsCMAccess) | (Inherited from FileCodeModel2.) | |
AddVariable(String, Object, Object, vsCMAccess) | Creates a new variable code construct and inserts the code in the correct location. | |
BeginBatch() | (Inherited from FileCodeModel2.) | |
BeginBatch() | Not currently implemented. | |
CodeElementFromFullName | Gets a collection of the specified code elements for the object. | |
CodeElementFromPoint(TextPoint, vsCMElement) | (Inherited from FileCodeModel2.) | |
CodeElementFromPoint(TextPoint, vsCMElement) | Gets a code element at a specific location in a source file. | |
CommitTransaction | Commits the current transaction for the object. | |
ElementFromID(String) | (Inherited from FileCodeModel2.) | |
ElementFromID(String) | Not currently implemented. | |
EndBatch() | (Inherited from FileCodeModel2.) | |
EndBatch() | Not currently implemented. | |
Remove(Object) | (Inherited from FileCodeModel2.) | |
Remove(Object) | Removes the specified project from the solution. | |
RemoveEx | Removes the specified project from the solution with an option to delete. | |
StartTransaction | Begins a transaction. | |
Synchronize() | (Inherited from FileCodeModel2.) | |
Synchronize() | Synchronizes all code model objects in the solution with edits made to source files. | |
ValidateMember | Validates that the proposed name is a valid C++ name for the kind given in the context of the parent object. |
Top
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.
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