Proprietà IVSSDatabase.VSSItem
Ottiene un riferimento del tipo IVSSItem a un oggetto che rappresenta un file o un progetto di Visual SourceSafe.
Spazio dei nomi: Microsoft.VisualStudio.SourceSafe.Interop
Assembly: Microsoft.VisualStudio.SourceSafe.Interop (in microsoft.visualstudio.sourcesafe.interop.dll)
Sintassi
'Dichiarazione
ReadOnly Property VSSItem ( _
<InAttribute> Spec As String, _
<InAttribute> <OptionalAttribute> Optional Deleted As Boolean = False _
) As VSSItem
'Utilizzo
Dim instance As IVSSDatabase
Dim Spec As String
Dim Deleted As Boolean
Dim value As VSSItem
value = instance.VSSItem(Spec, Deleted)
VSSItem VSSItem [
[InAttribute] string Spec,
[OptionalAttribute] [InAttribute] bool Deleted
] { get; }
property VSSItem^ VSSItem [String^, bool] {
VSSItem^ get ([InAttribute] String^ Spec, [InAttribute] [OptionalAttribute] bool Deleted);
}
/** @property */
VSSItem get_VSSItem (/** @attribute InAttribute() */ String Spec, /** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ boolean Deleted)
JScript supporta l'utilizzo di proprietà indicizzate ma non la dichiarazione di nuove.
Parametri
- Spec
Il percorso completo dell'elemento IVSSItem in Visual SourceSafe, ad esempio "$/" o $/MyProject/MyFile.txt".
Valore proprietà
Un riferimento del tipo IVSSItem a un oggetto che rappresenta un file o un progetto di Visual SourceSafe.
Note
[IDL]
HRESULT VSSItem ([in]BSTR Spec, [in,defaultvalue(0)]boolean bDeleted, (out,retval)IVSSItem **ppIVSSItem);
Esempio
Nell'esempio riportato di seguito viene illustrato come utilizzare la proprietà VSSItem per visualizzare il nome del progetto.
[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, "");
// vssFolder represents a SourceSafe project "TestFolder".
IVSSItem vssFolder = vssDatabase.get_VSSItem("$/TestFolder", false);
//Display project's name
Console.WriteLine("SourceSafe project's name is '" +
vssFolder.Name + "'.");
}
}
Output:
SourceSafe project's name is 'TestFolder'.
Imports System
Imports Microsoft.VisualStudio.SourceSafe.Interop
Module IVSSTest
Public Sub Main()
' Create a VSSDatabase object.
Dim vssDatabase As New VSSDatabase
' Open VSS database.
vssDatabase.Open("C:\VSSTestDB\srcsafe.ini", _
Environment.UserName, "")
' vssFolder represents a SourceSafe project "TestFolder".
Dim vssFolder As IVSSItem = _
vssDatabase.VSSItem("$/TestFolder", False)
' Display project's name
Console.WriteLine("SourceSafe project's name is '" + _
vssFolder.Name + "'.")
End Sub 'Main
End Module
Output:
SourceSafe project's name is 'TestFolder'.
Vedere anche
Riferimenti
Interfaccia IVSSDatabase
Membri IVSSDatabase
Spazio dei nomi Microsoft.VisualStudio.SourceSafe.Interop