CodeClass2.StartPoint Propriedade

Definição

Obtém um TextPoint objeto que define o início da classe.

public:
 property EnvDTE::TextPoint ^ StartPoint { EnvDTE::TextPoint ^ get(); };
public:
 property EnvDTE::TextPoint ^ StartPoint { EnvDTE::TextPoint ^ get(); };
[System.Runtime.InteropServices.DispId(10)]
public EnvDTE.TextPoint StartPoint { [System.Runtime.InteropServices.DispId(10)] [System.Runtime.InteropServices.TypeLibFunc(1024)] get; }
[<System.Runtime.InteropServices.DispId(10)>]
[<get: System.Runtime.InteropServices.DispId(10)>]
[<get: System.Runtime.InteropServices.TypeLibFunc(1024)>]
member this.StartPoint : EnvDTE.TextPoint
Public ReadOnly Property StartPoint As TextPoint

Valor da propriedade

TextPoint

Um objeto TextPoint.

Implementações

Atributos

Exemplos

[C#]

public void CodeClass2StartPointExample(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);  
        // Get TextPoint object at start of class.  
        TextPoint tp = cls.StartPoint;  
        // Get the line number where the class starts.  
        MessageBox.Show("The TextPoint object is located at line " +   
        tp.Line.ToString());  
    }  
    catch (Exception e)  
    {  
        MessageBox.Show(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