Share via


IVSSVersion.Action Property 

Gets a string representing an action that created this version of a file or a project.

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

Syntax

'Declaration
ReadOnly Property Action As String
'Usage
Dim instance As IVSSVersion
Dim value As String

value = instance.Action
string Action { get; }
property String^ Action {
    String^ get ();
}
/** @property */
String get_Action ()
function get Action () : String

Property Value

A string representing an action that created this version of a file or a project.

Remarks

[IDL]

HRESULT Action ([out,retval]BSTR *pAction);

A string includes the path of the file or project acted upon. For example, an Action property of the checked in file is "Checked in $/A".

The Action property has the following values:

“Added", “Archived", “Archived versions of", “Branched at version", “Checked in", “Created", “Deleted", “Destroyed", “Labeled", “Moved from", “Moved to", “Pinned to version", “Purged", “Recovered", “Renamed to", “Restored", “Rollback to version", “Shared", “Unpinned".

"Moved from" and "Move to" values apply to projects only, and do not apply to files.

Example

The following example demonstrates how to iterate through the IVSSVersions collection of a file and display the Action property for each version.

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

public class IVSSTest
{
    public static void Main()
    {
        string testFile = "$/A/test.txt";

        // Create a VSSDatabase object.
        IVSSDatabase vssDatabase = new VSSDatabase();

        // Open a VSS database using network name 
        // for automatic user login.
        vssDatabase.Open(@"C:\VSSTestDB\srcsafe.ini", 
                         Environment.UserName, ""); 

        Console.WriteLine("\n$/A/test.txt versions: \n");
        Console.WriteLine("-------------------------------------------------------");
        Console.WriteLine("{0,-4}{1,-14}{2,-15}{3,-16}", "Ver", 
                          "Comment", "Action", "Date");
        Console.WriteLine("-------------------------------------------------------");
        IVSSItem vssFile = vssDatabase.get_VSSItem(testFile, false);
        foreach(IVSSVersion vssVersion in vssFile.get_Versions(0))    
            Console.WriteLine("{0,-4}{1,-14}{2,-15}{3,-16}", 
                              vssVersion.VersionNumber, vssVersion.Comment, 
                              vssVersion.Action, vssVersion.Date);
        Console.WriteLine("-------------------------------------------------------");
    }
}

Output:

$/A/test.txt versions:

-------------------------------------------------------
Ver Comment       Action         Date
-------------------------------------------------------
14                Labeled 'Lbl1' 11/8/2003 12:41:12 PM
3   Ver 3         Checked in $/A 11/4/2003 10:47:30 PM
2   Ver 2         Checked in $/A 11/4/2003 10:46:48 PM
1                 Created        11/4/2003 10:45:52 PM
-------------------------------------------------------

See Also

Reference

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