Proprietà IVSSVersion.LabelComment

Ottiene una stringa contenente un commento applicato all'etichetta Label.

Spazio dei nomi: Microsoft.VisualStudio.SourceSafe.Interop
Assembly: Microsoft.VisualStudio.SourceSafe.Interop (in microsoft.visualstudio.sourcesafe.interop.dll)

Sintassi

'Dichiarazione
ReadOnly Property LabelComment As String
'Utilizzo
Dim instance As IVSSVersion
Dim value As String

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

Valore proprietà

Una stringa contenente un commento applicato all'etichetta Label oppure una stringa vuota, se non è disponibile alcun commento.

Note

[IDL]

HRESULT LabelComment([out, retval] BSTR *pComment);

Esempio

Nell'esempio riportato di seguito viene illustrato come scorrere l'insieme IVSSVersions di un file e visualizzare la proprietà LabelComment per ciascuna versione.

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, ""); 

        // Test Version:
        Console.WriteLine("\n$/A/test.txt versions: \n");
        IVSSItem vssFile = vssDatabase.get_VSSItem(testFile, false);
        Console.WriteLine("-------------------------------------------------");
        Console.WriteLine("{0,-5}{1,-9}{2,-15}{3,-7}{4}", "Ver", 
                          "Label", "Label Comment", "User", "Checked Out");
        Console.WriteLine("-------------------------------------------------");
        foreach(IVSSVersion vssVersion in vssFile.get_Versions(0))
        {
            string status;
            if((VSSFileStatus)vssVersion.VSSItem.IsCheckedOut == 
               VSSFileStatus.VSSFILE_NOTCHECKEDOUT)
                status = "NO";
            else    
                status = "YES";
            Console.WriteLine("{0,-5}{1,-9}{2,-15}{3,-7}{4}", 
                              vssVersion.VersionNumber, vssVersion.Label, 
                              vssVersion.LabelComment, vssVersion.Username, status);
        }    
        Console.WriteLine("-------------------------------------------------");
    }
}

Output:

$/A/test.txt versions:

-------------------------------------------------
Ver  Label    Label Comment   User     Checked Out
-------------------------------------------------
3    Lbl2     Attaching Lbl2  Guest1   NO
2                             Guest1   NO
1    Lbl1     Attaching Lbl1  Guest1   NO

Vedere anche

Riferimenti

Interfaccia IVSSVersion
Membri IVSSVersion
Spazio dei nomi Microsoft.VisualStudio.SourceSafe.Interop