IVSSItem.LocalSpec Property 

Gets or sets a fully qualified path of a working folder of a file or a project.

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

Syntax

'Declaration
Property LocalSpec As String
'Usage
Dim instance As IVSSItem
Dim value As String

value = instance.LocalSpec

instance.LocalSpec = value
string LocalSpec { get; set; }
property String^ LocalSpec {
    String^ get ();
    void set ([InAttribute] String^ pLocal);
}
/** @property */
String get_LocalSpec ()

/** @property */
void set_LocalSpec (/** @attribute InAttribute() */ String pLocal)
function get LocalSpec () : String

function set LocalSpec (pLocal : String)

Property Value

A string representing a fully qualified path of a working folder of a file or a project, or an empty string if no working folder is set.

Remarks

[IDL]

HRESULT LocalSpec ([out,retval]BSTR *pLocal);

HRESULT LocalSpec ([in]BSTR Local);

The working folder is a physical computer disk folder where VSS copies a database file during Check Out or Get operations. During Check In, VSS copies the local copy of a database file from your working folder to the database.

A working folder can be set only for a project and not a file. A file inherits its parent working folder. The LocalSpec property of a file object returns the working folder path including the file name. If you attempt to set the LocalSpec property of a file object, a run-time error is generated.

To empty a working folder, set the LocalSpec property to an empty string.

Example

The following example demonstrates how to use LocalSpec property to set and get the working folder of a project and get working the folder of a file.

[C#]

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

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

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

        // Get an IVSSItem reference to the project object.
        IVSSItem vssFolder = 
                 vssDatabase.get_VSSItem("$/TestFolder", false);
        // Get an IVSSItem reference to the file object.
        IVSSItem vssFile = 
                 vssDatabase.get_VSSItem("$/TestFolder/test.txt", false);
        
        // Set working folder for "TestFolder" project.
        vssFolder.LocalSpec = "C:\\VSSTESTWF\\TestFolder";
        Console.WriteLine("The working folder for " + vssFolder.Spec + 
                          " is " + vssFolder.LocalSpec);
        Console.WriteLine("The working folder for " + vssFile.Spec + 
                          " is " + vssFile.LocalSpec);
    }
}

Output:

The working folder for $/TestFolder is C:\VSSTESTWF\TestFolder

The working folder for $/TestFolder/test.txt is C:\VSSTESTWF\TestFolder\test.txt

See Also

Reference

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