IVSSItem.Move Method 

Moves a subproject from the current parent project to a new parent project.

Namespace: Microsoft.VisualStudio.SourceSafe.Interop
Assembly: Microsoft.VisualStudio.SourceSafe.Interop (in microsoft.visualstudio.sourcesafe.interop.dll)


Sub Move ( _
    <InAttribute> pINewParent As VSSItem _
Dim instance As IVSSItem
Dim pINewParent As VSSItem

void Move (
    [InAttribute] VSSItem pINewParent
void Move (
    [InAttribute] VSSItem^ pINewParent
void Move (
    /** @attribute InAttribute() */ VSSItem pINewParent
function Move (
    pINewParent : VSSItem


  • pINewParent
    A reference of the IVSSItem type to an object representing a new parent project where the subproject is moved.



HRESULT Move ([in]IVSSItem *pINewParent);

The Move method applies to projects only. When you move a project, you move all its children as well. If you attempt to move a file or move a project to its current parent, a run-time error is generated.


The following example demonstrates how to use the Move method to move a project from one parent to another. To run this example create $/A and $/B folders.

using System;
using Microsoft.VisualStudio.SourceSafe.Interop;

public class IVSSTest
    public static void Main()
        // Create a VSSDatabase object.
        IVSSDatabase vssDatabase = new VSSDatabase();

        // Open a VSS database using network name 
        // for automatic user login.
                         Environment.UserName, ""); 

        IVSSItem VSS_SourceItem = vssDatabase.get_VSSItem("$/A/", false);
        VSSItem VSS_TargetItem = vssDatabase.get_VSSItem("$/B/", false);

        // Move folder A from folder $/ to folder B.
        Console.WriteLine("- Moving Folder A from folder $/ to Folder B");

        // Move folder A from folder B to folder $/.
        VSS_SourceItem = vssDatabase.get_VSSItem("$/B/A/", false);
        VSS_TargetItem = vssDatabase.get_VSSItem("$/", false);
        Console.WriteLine("- Moving folder A from folder B to $/");

    private static void DisplayParent(IVSSItem vssItem)
        Console.WriteLine("{0}'s folder parent is folder {1}", 
                          vssItem.Spec, vssItem.Parent.Spec);


$/A's folder parent is folder $/

- Moving Folder A from folder $/ to Folder B

$/B/A's folder parent is folder $/B

- Moving folder A from folder B to $/

$/A's folder parent is folder $/

See Also


IVSSItem Interface
IVSSItem Members
Microsoft.VisualStudio.SourceSafe.Interop Namespace