Compartilhar via


Propriedade Reference3.SpecificVersion

Obtém ou define se é usada somente uma versão específica da referência.

Namespace:  VSLangProj80
Assembly:  VSLangProj80 (em VSLangProj80.dll)

Sintaxe

Property SpecificVersion As Boolean

Dim instance As Reference3
Dim value As Boolean

value = instance.SpecificVersion

instance.SpecificVersion = value
bool SpecificVersion { get; set; }
property bool SpecificVersion {
    bool get ();
    void set (bool value);
}
function get SpecificVersion () : boolean
function set SpecificVersion (value : boolean)

Valor de propriedade

Tipo: System.Boolean
A boolean valor que indica se apenas uma determinada versão da referência é utilizada.

Comentários

Esta propriedade permite que você para uma versão específica de uma referência a um assembly para um projeto de destino.

Exemplos

Este exemplo exibe o SpecificVersion valor para cada referência em aberto Visual Basic, Visual C#, ou Visual J# projeto. Para executar este exemplo sistema autônomo um suplemento, consulte Como: Compilar e executar os exemplos de códigos automação modelo de objeto.

Imports VSLangProj
Imports VSLangProj2
Imports VSLangProj80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    applicationObject = CType(application, DTE2)
    addInInstance = CType(addInInst, AddIn)
    DisplaySpecificVersionValue(applicationObject)
End Sub
Public Sub DisplaySpecificVersionValue(ByVal dte As DTE2)
    ' The first project is a Visual Basic, C#, or J# project.
    Dim vsProject As VSProject2 =_
    CType(applicationObject.Solution.Projects.Item(1).Object, _
    VSProject2)
    Dim aRef As Reference3
    Dim refStr As String
    refStr = ""
    For Each aRef In vsProject.References
        refStr += (aRef.Name & " has a specific version value of: " _
        & aRef.SpecificVersion.ToString() & vbCr & vbCr)
    Next
    MsgBox(refStr)
End Sub
using System.Windows.Forms;
using VSLangProj;
using VSLangProj2;
using VSLangProj80;
public void OnConnection(object application,
 ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    applicationObject = (DTE2)application;
    addInInstance = (AddIn)addInInst;
    DisplaySpecificVersionValue(((DTE2)applicationObject));
}
public void DisplaySpecificVersionValue(DTE2 dte)
{
    // The first project is a Visual Basic, C#, or J# project.
    VSProject2 aProject = 
((VSProject2)(applicationObject.Solution.Projects.Item(1).Object));
    Reference3 aRef = null;
    string refStr = null;
    refStr = "";
    foreach (VSLangProj80.Reference3 temp in aProject.References)
    {
        aRef = temp; 
        refStr += (aRef.Name + " has a specific version value of: " 
+aRef.SpecificVersion.ToString() + "\n" + "\n");
    }
    MessageBox.Show(refStr);
}

Permissões

Consulte também

Referência

Reference3 Interface

Membros Reference3

Namespace VSLangProj80