VCFile.Move Method (Object)

 

Moves a file or folder into the top level of the project or a new folder.

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

void Move(
	object Parent
)

Parameters

Parent
Type: System.Object

Required. The project or folder into which you want to move the file or folder. This parent must be in the same project as the current file or folder being moved.

The file or folder that will be moved is the object on which you are calling Move. The destination of the move is the parameter passed to Move. See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.

The following example uses Move in the integrated development environment (IDE):

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim MyCol As IVCCollection
        Dim file As VCFile
        Dim folder As VCFilter
        prj = DTE.Solution.Projects.Item(1).Object
        MyCol = prj.Filters
        folder = MyCol.Item("MyFolder")
        MyCol = prj.Files
        file = MyCol.Item("MyFile.txt")
        file.Move(folder)
    End Sub
End Module
Return to top
Show: