Proprietà Project.UniqueName

Aggiornamento: novembre 2007

Ottiene un valore stringa univoco che consente di distinguere progetti con nomi simili.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

ReadOnly Property UniqueName As String

Dim instance As Project
Dim value As String

value = instance.UniqueName
string UniqueName { get; }
property String^ UniqueName {
    String^ get ();
}
function get UniqueName () : String

Valore proprietà

Tipo: System.String

Stringa che rappresenta un valore univoco che consente di distinguere progetti con nomi simili.

Note

UniqueName viene utilizzato principalmente per indicizzare Solution.Item("..."). Questo metodo restituisce un valore stinga univoco temporaneo che consente di distinguere un progetto dall'altro. Mentre di confronta un valore UniqueName a un altro, il valore effettivo della stringa non ha alcun significato perché viene utilizzato solo a scopo di confronto.

Per un confronto significativo utilizzare invece la proprietà FullName o una combinazione di proprietà permanenti simili.

Esempi

Sub UniqueNameExample()
   Dim proj As Project
   Dim projitems As ProjectItems
   Dim msg As String

   ' Reference the current solution and its projects and project items.
   proj = DTE.ActiveSolutionProjects(0)
   projitems = proj.ProjectItems

   ' List properties of the project and its items.
   msg = "Is the item open? " & projitems.Item(1).IsOpen & Chr(13)
   msg = msg & "The project's unique name: " & proj.UniqueName
   ' The following two properties work only if the current project 
   ' contains subprojects. If it does, then uncomment the lines to run 
   ' them.
   ' msg = msg & "The parent project item name: " & proj.ParentProjectItem.Name & Chr(13)
   ' msg = msg & "The subproject name: " & projitems.Item(1).SubProject.Name & Chr(13)
   MsgBox(msg)
End Sub

Autorizzazioni

Vedere anche

Riferimenti

Project Interfaccia

Membri Project

Spazio dei nomi EnvDTE

Altre risorse

Controllo di progetti e soluzioni