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)

[GuidAttribute("0624857C-D3E4-4DC1-9E8D-401434E07364")]
public interface VCFileCodeModel : FileCodeModel2

The VCFileCodeModel type exposes the following members.

  NameDescription
Public propertyAttributesGets a collection of all of the attributes for the object.
Public propertyClassesGets a collection of classes for the object.
Public propertyCodeElementsGets a collection of code elements.
Public propertyDelegatesGets a collection of delegates for the object.
Public propertyDTEGets the top-level extensibility object.
Public propertyEndPointGets the edit point that is the location of the end of the code item.
Public propertyEnumsGets a collection of enumerations for the object.
Public propertyFunctionsGets a collection of functions for the object.
Public propertyIDLImportsGets the collection of Import statements from the .idl file of the object.
Public propertyIDLLibrariesGets the collection of Library elements on the object.
Public propertyImportsGets the collection of #import statements for the object.
Public propertyIncludesGets the collection of #include statements for the object.
Public propertyInterfacesGets the collection of interfaces for the object.
Public propertyIsBatchOpenNot currently implemented.
Public propertyIsManagedGets true if the ref keyword is used.
Public propertyIsMCOldSyntaxGets a value indicating whether the file was compiled using the old syntax.
Public propertyIsSynchronizedNot implemented.
Public propertyLanguageGets the programming language used to author the code.
Public propertyMacrosGets the collection of macros (#define statements) for the object.
Public propertyMapsGets the collection of maps for the object.
Public propertyNamespacesGets the collection of namespaces for the object.
Public propertyParentGets the immediate parent object of a given object.
Public propertyParseStatusGets an enumeration defining the outcome of parsing the file for the code model.
Public propertyStartPointGets a TextPoint object that defines the beginning of the code item.
Public propertyStructsGets the collection of structure elements for the object.
Public propertyTypedefsGets the collection of typedef elements for the object.
Public propertyUnionsGets the collection of union elements for the object.
Public propertyUsingAliases
Public propertyUsingsGets the collection of #using elements for the object.
Public propertyVariablesGets the collection of variables for the object.
Top

  NameDescription
Public methodAbortTransactionHalts the current transaction.
Public methodAddAttributeCreates a new attribute code construct and inserts the code in the correct location.
Public methodAddClassCreates a new class code construct and inserts the code in the correct location.
Public methodAddDelegateCreates a new delegate code construct and inserts the code in the correct location.
Public methodAddEnumCreates a new enumeration code construct and inserts the code in the correct location.
Public methodAddFunctionCreates a new function code construct and inserts the code in the correct location.
Public methodAddIDLImportAdds a new import statement to the .idl file of the VCFileCodeModel object.
Public methodAddIDLLibraryAdds a new library statement to the .idl file of the VCFileCodeModel object.
Public methodAddImportAdds a #import element to the VCFileCodeModel object.
Public methodAddImport_2Adds a #import element to the VCFileCodeModel object.
Public methodAddIncludeAdds a #include element to the VCFileCodeModel object.
Public methodAddInterfaceCreates a new interface code construct and inserts the code in the correct location.
Public methodAddMacroAdds a #define element to the VCFileCodeModel object.
Public methodAddMapAdds a map to the object.
Public methodAddNamespaceCreates a new namespace code construct and inserts the code in the correct location.
Public methodAddStructCreates a new structure code construct and inserts the code in the correct location.
Public methodAddTypedefAdds a typedef statement to the object.
Public methodAddUnionAdds a union statement to the object.
Public methodAddUsingAdds a #using element to the VCFileCodeModel object.
Public methodAddUsingAlias
Public methodAddVariableCreates a new variable code construct and inserts the code in the correct location.
Public methodBeginBatchNot currently implemented.
Public methodCodeElementFromFullNameGets a collection of the specified code elements for the object.
Public methodCodeElementFromPointGets a code element at a specific location in a source file.
Public methodCommitTransactionCommits the current transaction for the object.
Public methodElementFromIDNot currently implemented.
Public methodEndBatchNot currently implemented.
Public methodRemoveRemoves the specified project from the solution.
Public methodRemoveExRemoves the specified project from the solution with an option to delete.
Public methodStartTransactionBegins a transaction.
Public methodSynchronizeSynchronizes all code model objects in the solution with edits made to source files.
Public methodValidateMemberValidates that the proposed name is a valid C++ name for the kind given in the context of the parent object.
Public methodValidateMemberName
Top

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

NoteNote

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.

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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft