IVSSCheckout.Date Property 

Gets the date and the time of the file checkout.

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

Syntax

'Declaration
ReadOnly Property Date As DateTime
'Usage
Dim instance As IVSSCheckout
Dim value As DateTime

value = instance.Date
DateTime Date { get; }
property DateTime Date {
    DateTime get ();
}
/** @property */
DateTime get_Date ()
function get Date () : DateTime

Property Value

The date and the time of the file checkout.

Remarks

[IDL]

HRESULT Date ([out,retval]DATE *pDate);

Example

The following example demonstrates how to iterate through the IVSSCheckouts collection of a file and display the Date property for each checkout.

To perform this test, the file $/A/a.txt must be checked out by two users. Multiple checkouts must be enabled by the VSS Administrator. To enable multiple checkouts, on the Tools menu, click Options, click the General tab, select the Allow Multiple Checkouts check box, and click OK.

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

Comment : Check out to working folder

Date : 11/10/2003 10:52:40 AM

LocalSpec : C:\VSSTESTWF\A

Machine : Tester_01

Project : $/A

VersionNumber : 1

Checked out to : Admin

Comment : Check out to folder C:\1

Date : 11/10/2003 10:51:56 AM

LocalSpec : C:\1

Machine : Tester_02

Project : $/A

VersionNumber : 1

Number of checkouts: 2

See Also

Reference

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