CodeClass2.InheritanceKind Propriedade

Definição

Obtém ou define um valor que indica se uma classe pode ser usada para criar uma nova classe.

public:
 property EnvDTE80::vsCMInheritanceKind InheritanceKind { EnvDTE80::vsCMInheritanceKind get(); void set(EnvDTE80::vsCMInheritanceKind value); };
public:
 property EnvDTE80::vsCMInheritanceKind InheritanceKind { EnvDTE80::vsCMInheritanceKind get(); void set(EnvDTE80::vsCMInheritanceKind value); };
[System.Runtime.InteropServices.DispId(207)]
public EnvDTE80.vsCMInheritanceKind InheritanceKind { [System.Runtime.InteropServices.DispId(207)] get; [System.Runtime.InteropServices.DispId(207)] set; }
[<System.Runtime.InteropServices.DispId(207)>]
[<get: System.Runtime.InteropServices.DispId(207)>]
[<set: System.Runtime.InteropServices.DispId(207)>]
member this.InheritanceKind : EnvDTE80.vsCMInheritanceKind with get, set
Public Property InheritanceKind As vsCMInheritanceKind

Valor da propriedade

vsCMInheritanceKind

Uma constante vsCMInheritanceKind.

Atributos

Exemplos

[C#]

public void CodeClass2InheritanceKindExample(DTE2 dte2)  
{  
    // Before running this example, open a code document from a project  
    // and place the insertion point within a class definition.  
    try  
    {   // Get the CodeClass2 at the insertion point.  
        TextSelection sel =   
        (TextSelection)dte2.ActiveDocument.Selection;  
        CodeClass2 cls = (CodeClass2)sel.ActivePoint.get_CodeElement(  
            vsCMElement.vsCMElementClass);  

        // Show whether class may be inherited.  
        if (cls.InheritanceKind ==   
        vsCMInheritanceKind.vsCMInheritanceKindSealed)  
            MessageBox.Show("This class is sealed");  
        else MessageBox.Show("This class may be used to create a new   
        class");  
    }  
    catch (Exception e)  
    {  
        Console.WriteLine(e.Message);  
    }  
}  

Comentários

Observação

Os valores dos elementos de modelo de código, como classes, structs, funções, atributos, delegados e assim por diante, podem ser não determinísticos depois de fazer determinados tipos de edições, o que significa que seus valores não podem ser dependentes para sempre permanecerem os mesmos. Para obter mais informações, consulte os valores de elemento de modelo de código de seção podem ser alterados na descoberta de código usando o modelo de código (Visual Basic).

Aplica-se a