CodeClass.ImplementedInterfaces Özellik

Tanım

Bir nesne tarafından uygulanan arabirimlerin koleksiyonunu alır CodeClass .

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

CodeElements

Bir CodeElements koleksiyon.

Öznitelikler

Örnekler

 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 bir CodeElements koleksiyon, türündeki her öğe 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).

Şunlara uygulanır