CodeClass2.EndPoint – vlastnost
Získá upravit bod, který je umístěn na konec kódu třídy.
Obor názvů: EnvDTE80
Sestavení: EnvDTE80 (v EnvDTE80.dll)
Syntaxe
'Deklarace
ReadOnly Property EndPoint As TextPoint
TextPoint EndPoint { get; }
property TextPoint^ EndPoint {
TextPoint^ get ();
}
abstract EndPoint : TextPoint with get
function get EndPoint () : TextPoint
Hodnota vlastnosti
Typ: TextPoint
Objekt TextPoint.
Poznámky
Upravit umístění bodu je ihned po poslední znak prvek kódu (včetně všech středník, ukončení syntaxe nebo dělicí syntaxe).Načítání vlastnosti implicitně otevře zdrojový soubor, pokud lze otevřít.Některé jazyky však nelze otevřít libovolné soubory na disku a lze otevřít pouze soubory v aktuálně otevřené řešení.
[!POZNÁMKA]
Není deterministický může být po provedení určité typy úprav, což znamená, že jejich hodnoty nelze dovolávat vždy zůstat stejné hodnoty prvků modelu kód jako třídy, struktury, funkce, atributy, delegátů a tak dále.Další informace naleznete v části Změna hodnoty prvků modelu kód Zjišťování kódu pomocí modelu kódu (Visual Basic).
Příklady
[Visual Basic]
Sub EndPointExample2(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)
Dim start As EditPoint = cls.StartPoint.CreateEditPoint()
Dim def As String = start.GetText(cls.EndPoint)
MsgBox(cls.Name & " has the following definition:" & _
vbCrLf & vbCrLf & def)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
[C#]
public void EndPointExample2(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);
EditPoint start = cls.StartPoint.CreateEditPoint();
string def = start.GetText(cls.EndPoint);
MessageBox.Show(cls.Name +
" has the following definition:\n\n" + def);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Zabezpečení rozhraní .NET Framework
- Plná důvěra přímému volajícímu. Částečně zabezpečený kód nemůže tento člen použít. Další informace naleznete v tématu Používání knihoven z částečně důvěryhodného kódu.
Viz také
Referenční dokumentace
Další zdroje
Postupy: Kompilace a spuštění příkladů kódu objektu automatizace