Método EditPoint.ClearBookmark
Limpa todos os indicadores sem nome na linha atual do buffer de texto.
Namespace: EnvDTE
Assembly: EnvDTE (em EnvDTE.dll)
Sintaxe
'Declaração
Sub ClearBookmark
void ClearBookmark()
void ClearBookmark()
abstract ClearBookmark : unit -> unit
function ClearBookmark()
Exemplos
Sub ClearBookmarkExample(ByVal dte As DTE2)
' Create a new text document.
dte.ItemOperations.NewFile()
' Create an EditPoint at the start of the new document.
Dim doc As TextDocument = _
CType(dte.ActiveDocument.Object("TextDocument"), TextDocument)
Dim point As EditPoint = doc.StartPoint.CreateEditPoint
Dim i As Integer
'Insert ten lines of text.
For i = 1 To 10
point.Insert("This is a test." & vbCrLf)
Next
point.StartOfDocument()
' Set a bookmark on each of the first two lines.
point.SetBookmark()
point.LineDown(1)
point.SetBookmark()
' Insert text at each bookmark and then clear each bookmark.
point.PreviousBookmark()
point.Insert("BOOKMARK 1: ")
point.ClearBookmark()
point.NextBookmark()
point.Insert("BOOKMARK 2: ")
point.ClearBookmark()
End Sub
public void ClearBookmarkExample(DTE2 dte)
{
// Create a new text document.
dte.ItemOperations.NewFile(@"General\Text File", "", _
Constants.vsViewKindPrimary);
// Create an EditPoint at the start of the new document.
TextDocument doc = _
(TextDocument)dte.ActiveDocument.Object("TextDocument");
EditPoint point = doc.StartPoint.CreateEditPoint();
// Insert ten lines of text.
for (int i = 1; i <= 10; ++i)
point.Insert("This is a test.\n");
point.StartOfDocument();
// Set a bookmark on each of the first two lines.
point.SetBookmark();
point.LineDown(1);
point.SetBookmark();
// Insert text at each bookmark and then clear each bookmark.
point.PreviousBookmark();
point.Insert("BOOKMARK 1: ");
point.ClearBookmark();
point.NextBookmark();
point.Insert("BOOKMARK 2: ");
point.ClearBookmark();
}
Segurança do .NET Framework
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de código parcialmente confiáveis.
Consulte também
Referência
Outros recursos
Como: compilar e executar os exemplos de código de modelo de objeto de automação