CodeClass2.ImplementedInterfaces Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Kod sınıfı tarafından uygulanan arabirimlerin bir koleksiyonunu alır.
public:
property EnvDTE::CodeElements ^ ImplementedInterfaces { EnvDTE::CodeElements ^ get(); };
[System.Runtime.InteropServices.DispId(61)]
public EnvDTE.CodeElements ImplementedInterfaces { [System.Runtime.InteropServices.DispId(61)] [System.Runtime.InteropServices.TypeLibFunc(1024)] get; }
[<System.Runtime.InteropServices.DispId(61)>]
[<get: System.Runtime.InteropServices.DispId(61)>]
[<get: System.Runtime.InteropServices.TypeLibFunc(1024)>]
member this.ImplementedInterfaces : EnvDTE.CodeElements
Public ReadOnly Property ImplementedInterfaces As CodeElements
Özellik Değeri
Bir CodeElements koleksiyon.
Uygulamalar
- Öznitelikler
Örnekler
[Visual Basic]
Sub ImplementedInterfacesExample(ByVal dte As DTE2)
' Before running this example, open a code document from a project
' and place the insertion point inside a class definition.
Try
' Retrieve the CodeClass at the insertion point.
Dim sel As TextSelection = _
CType(dte.ActiveDocument.Selection, TextSelection)
Dim cls As CodeClass = _
CType(sel.ActivePoint.CodeElement( _
vsCMElement.vsCMElementClass), CodeClass)
' Display the class's implemented interfaces.
Dim ifaces As String
Dim iface As CodeInterface
For Each iface In cls.ImplementedInterfaces
ifaces &= iface.Name & vbCrLf
Next
MsgBox(cls.Name & " implements the following interfaces:" & _
vbCrLf & vbCrLf & ifaces)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Þ
public void ImplementedInterfacesExample(DTE2 dte)
{
// Before running this example, open a code document from a project
// and place the insertion point inside a class definition.
try
{
// Retrieve the CodeClass at the insertion point.
TextSelection sel =
(TextSelection)dte.ActiveDocument.Selection;
CodeClass cls =
(CodeClass)sel.ActivePoint.get_CodeElement(
vsCMElement.vsCMElementClass);
// Display the class's implemented interfaces.
string ifaces = "";
foreach (CodeInterface iface in cls.ImplementedInterfaces)
ifaces += iface.Name + "\n";
MessageBox.Show(cls.Name +
" implements the following interfaces:\n\n" + ifaces);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Açıklamalar
ImplementedInterfacesÖzelliği bir koleksiyon döndürür CodeElements . Her öğe türü vsCMElementInterface (bkz vsCMElement .) ve kod sınıfı tarafından uygulanan bir arabirimi temsil eder.
Not
Sınıfların, yapıların, işlevlerin, özniteliklerin, temsilcilerin ve bu gibi kod modeli öğelerinin değerleri, belirli tür düzenlemeler yapıldıktan sonra belirleyici olmayan bir değer olabilir, yani değerlerinin her zaman aynı kalır. Daha fazla bilgi için bkz. kod modeli öğe değerleri, kod modeli kullanılarak kod bulma bölümünde değişebilir (Visual Basic).