Freigeben über


Reference3.Resolved-Eigenschaft

Ruft ab, ob der aktuelle Verweis aufgelöst wurde.

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

Syntax

'Declaration
ReadOnly Property Resolved As Boolean
bool Resolved { get; }
property bool Resolved {
    bool get ();
}
abstract Resolved : bool with get
function get Resolved () : boolean

Eigenschaftswert

Typ: Boolean
true , wenn der Verweis aufgelöst würde, andernfalls false.

Hinweise

Weitere Informationen zum Auflösen von Verweisen finden Sie unter Add.

Beispiele

In diesem Beispiel werden die Verweise in einem geöffneten Visual Basic- oder Visual C#-Projekt durchlaufen. Anschließend wird bestimmt, ob sie aufgelöst werden oder nicht. Um dieses Beispiel als Add-In auszuführen, informieren Sie sich unter Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell.

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)
    DisplayResolvedStatus(applicationObject)
End Sub
Public Sub DisplayResolvedStatus(ByVal dte As DTE2)
    ' The first project is a Visual Basic or C# 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 & " is resolved, or not? : " _
        & aRef.Resolved.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;
    DisplayResolvedStatus(((DTE2)applicationObject));
}
public void DisplayResolvedStatus(DTE2 dte)
{
    // The first project is a Visual Basic or C# 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 + " is resolved, or not? : " 
+ aRef.Resolved.ToString() + "\n" + "\n");
    }
    MessageBox.Show(refStr);
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Reference3 Schnittstelle

VSLangProj80-Namespace