Metoda VCCodeInterface.IsSelf —

Określa, jeśli element określony kod jest taki sam jak inny element kodu.

Przestrzeń nazw:  Microsoft.VisualStudio.VCCodeModel
Zestaw:  Microsoft.VisualStudio.VCCodeModel (w Microsoft.VisualStudio.VCCodeModel.dll)

Składnia

'Deklaracja
Function IsSelf ( _
    pOther As Object _
) As Boolean
bool IsSelf(
    Object pOther
)
bool IsSelf(
    [InAttribute] Object^ pOther
)
abstract IsSelf : 
        pOther:Object -> bool
function IsSelf(
    pOther : Object
) : boolean

Parametry

  • pOther
    Typ: Object

    Wymagane.Porównywane do elementu kodu.

Wartość zwracana

Typ: Boolean
true Jeśli element określony kod jest identyczny z innym elementem kodu; w przeciwnym razie false.

Uwagi

Zobacz Porady: kompilowanie przykładowego kodu dla rozszerzalności modelu kodu Visual C++ informacji na temat skompilować i uruchomić tej próbki.

Przykłady

W tym przykładzie porównuje dwa elementy kodu.Jeśli stanowią one ten sam obiekt zostanie wyświetlony komunikat.

[Programu Visual Basic]

Sub IsSameObject()
    Dim vcElements As VCCodeElements
    Dim codeElem1 As VCCodeElement
    Dim codeElem2 As VCCodeElement
    vcElements = DTE.Solution.Item(1).CodeModel.Classes
    codeElem1 = vcElements.Item(1)
    codeElem2 = vcElements.Item(2)
    If (codeElem1.IsSelf(codeElem2)) Then
        MsgBox(codeElem1.Name + " and " + codeElem2.Name + " represent the same object.")
    End If
End Sub

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

VCCodeInterface Interfejs

Przestrzeń nazw Microsoft.VisualStudio.VCCodeModel