VCCodeStruct.IsSelf - метод
Determines if the specified code element is the same as the parent code element.
Пространство имен: Microsoft.VisualStudio.VCCodeModel
Сборка: Microsoft.VisualStudio.VCCodeModel (в Microsoft.VisualStudio.VCCodeModel.dll)
Синтаксис
'Декларация
Function IsSelf ( _
pOther As Object _
) As Boolean
'Применение
Dim instance As VCCodeStruct
Dim pOther As Object
Dim returnValue As Boolean
returnValue = instance.IsSelf(pOther)
bool IsSelf(
Object pOther
)
bool IsSelf(
[InAttribute] Object^ pOther
)
function IsSelf(
pOther : Object
) : boolean
Параметры
pOther
Тип: System.ObjectRequired. The code element to which the code element is being compared.
Возвращаемое значение
Тип: System.Boolean
true if the specified code element is the same as the parent code element; otherwise, false.
Заметки
See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.
Примеры
This example compares two code elements. If they represent the same object a message is displayed.
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
Разрешения
- Полное доверие для непосредственно вызывающего метода. Этот член не может быть использован частично доверенным кодом. Дополнительные сведения см. в разделе Using Libraries from Partially Trusted Code.