Compartilhar via


VCFileCodeModel.Synchronize Method

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

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

Syntax

'Declaration
Sub Synchronize
void Synchronize()
void Synchronize()
abstract Synchronize : unit -> unit
function Synchronize()

Remarks

On rare occasions, it may be necessary to synchronize the code model object with the file buffers. This is sometimes necessary when you directly modify the file buffer.

Examples

This example adds a template parameter list to the class.

Sub AddTemplateClass()
    Dim vcCM As VCCodeModel
    Dim vcClass As VCCodeClass
    vcCM = DTE.Solution.Item(1).CodeModel
    vcClass = vcCM.AddClass("MyTemplateClass", "MyTemplateClass.h")
    vcClass.StartPoint().CreateEditPoint().Insert("template <class T> ")
    vcCM.Synchronize()
End Sub

.NET Framework Security

See Also

Reference

VCFileCodeModel Interface

Microsoft.VisualStudio.VCCodeModel Namespace