IVSSDatabase.CurrentProject Property 

Gets or sets a string representing the name of the current project of the IVSSUser.

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

Syntax

'Declaration
Property CurrentProject As String
'Usage
Dim instance As IVSSDatabase
Dim value As String

value = instance.CurrentProject

instance.CurrentProject = value
string CurrentProject { get; set; }
property String^ CurrentProject {
    String^ get ();
    void set ([InAttribute] String^ pPrj);
}
/** @property */
String get_CurrentProject ()

/** @property */
void set_CurrentProject (/** @attribute InAttribute() */ String pPrj)
function get CurrentProject () : String

function set CurrentProject (pPrj : String)

Property Value

A string representing a name of the current project of the IVSSUser.

Remarks

[IDL]

HRESULT CurrentProject ([out,retval]BSTR *pPrj);

HRESULT CurrentProject ([in]BSTR Prj);

Each SourceSafe user has his or her own unique SS.INI file that includes a set of variables that are used to configure the SourceSafe Explorer. The CurrentProject property may be used to set or return the value of the variable that contains the name of the currently selected project. The effect of setting the CurrentProject property takes place when the user restarts SourceSafe.

Example

The following example demonstrates how to use the CurrentProject property to retrieve the name of a current project selected in the project pane of the SourceSafe Explorer.

[C#]

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.
        vssDatabase.Open(@"C:\VSSTestDB\srcsafe.ini", 
                         Environment.UserName, "");
        // Display user's current project.
        Console.WriteLine("The {0}'s current project is '{1}'", 
                          vssDatabase.Username, 
                          vssDatabase.CurrentProject);
    }
}

Output:

The Guest's current project is '$/MyProject'

See Also

Reference

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