Proprietà IVSSItem.Checkouts

Ottiene un riferimento del tipo IVSSCheckouts a un oggetto che rappresenta l'insieme delle estrazioni, IVSSCheckouts, di un file.

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

Sintassi

'Dichiarazione
ReadOnly Property Checkouts As IVSSCheckouts
'Utilizzo
Dim instance As IVSSItem
Dim value As IVSSCheckouts

value = instance.Checkouts
IVSSCheckouts Checkouts { get; }
property IVSSCheckouts^ Checkouts {
    IVSSCheckouts^ get ();
}
/** @property */
IVSSCheckouts get_Checkouts ()
function get Checkouts () : IVSSCheckouts

Valore proprietà

Un riferimento del tipo IVSSCheckouts a un oggetto che rappresenta l'insieme IVSSCheckouts di un file.

Note

[IDL]

HRESULT Checkouts ([out,retval]IVSSCheckouts **ppICheckouts);

Se il file non è stato estratto, l'insieme Checkouts non conterrà alcun elemento. Se il file è stato estratto una volta, nell'insieme risulterà un singolo elemento. Un file può essere estratto da utenti diversi o dallo stesso utente su più computer.

Quando si scorre l'insieme Checkouts, si passa cronologicamente dall'estrazione più recente a quella meno recente. Per verificare se una particolare estrazione è quella desiderata, è possibile convalidare una o più delle relative proprietà (Comment, Date, LocalSpec, Machine, Project, UserName e VersionNumber).

La proprietà Checkouts viene applicata solo agli oggetti di tipo file. Se si tenta di accedere alla proprietà Checkouts di un oggetto di tipo progetto, verrà generato un errore di run-time.

Esempio

Nell'esempio riportato di seguito viene illustrato come utilizzare la proprietà Checkouts scorrendo l'insieme Checkouts.

Per eseguire il test, il file $/A/a.txt deve essere estratto da due utenti. Le estrazioni multiple devono essere attivate dall'amministratore VSS. Per attivare le estrazioni multiple, scegliere Opzioni dal menu Strumenti, quindi fare clic sulla scheda Generale, selezionare la casella di controllo Consenti estrazioni multiple e infine scegliere OK.

[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, ""); 
            
        // Get an IVSSItem reference to the file object.
        IVSSItem vssFile = vssDatabase.get_VSSItem("$/A/a.txt", false);

        foreach(IVSSCheckout vssCheckout in vssFile.Checkouts)
        {
            Console.WriteLine("Checked out to : {0}", vssCheckout.Username);
            Console.WriteLine("Comment        : {0}", vssCheckout.Comment);
            Console.WriteLine("Date           : {0}", vssCheckout.Date);
            Console.WriteLine("LocalSpec      : {0}", vssCheckout.LocalSpec);
            Console.WriteLine("Machine        : {0}", vssCheckout.Machine);
            Console.WriteLine("Project        : {0}", vssCheckout.Project);
            Console.WriteLine("VersionNumber  : {0}", vssCheckout.VersionNumber);
            Console.WriteLine();
        }    
        Console.WriteLine("Number of Checkouts: " + vssFile.Checkouts.Count);
        Console.WriteLine("\n");
    }
}

Output:

Checked out to: Guest 1

Comment: Comment by Guest 1

Date: 10/9/2003 8:58:02 AM

LocalSpec: C:\1\3

Machine: C1480406-A

Project: $/A

VersionNumber: 48

Checked out to: Guest 2

Comment: Comment by Guest 2

Date: 10/9/2003 6:22:10 AM

LocalSpec: C:\1

Machine: C1480400-A

Project: $/A

VersionNumber: 48

Number of Checkouts: 2

Vedere anche

Riferimenti

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