EditPoint.PreviousBookmark أسلوب
نقل نقطة التحرير إلى الموقع الإشارة المرجعية السابقة في المستند.
مساحة الاسم: EnvDTE
التجميع: EnvDTE (في EnvDTE.dll)
بناء الجملة
'إقرار
Function PreviousBookmark As Boolean
bool PreviousBookmark()
bool PreviousBookmark()
abstract PreviousBookmark : unit -> bool
function PreviousBookmark() : boolean
القيمة المُرجعة
النوع: System.Boolean
A منطقي القيمة indicating true if the تحرير يؤشر moves إلى a السابق إشارة مرجعية, false if not.
ملاحظات
If there are لا المزيد إشارات مرجعية, the تحرير يؤشر ليس moved.
PreviousBookmark moves the EditPoint كائن إلى the الموقع of the أول إشارة مرجعية preceding the الموقع of the نشط إنهاء of the EditPoint. The EditPoint هو مطوي at the الموقع جديد.
أمثلة
Sub PreviousBookmarkExample(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 PreviousBookmarkExample(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();
}
أمن NET Framework.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.
راجع أيضًَا
المرجع
موارد أخرى
كيفية: الترجمة وإعادة تشغيل أمثلة التعليمات البرمجية لطراز كائن التنفيذ التلقائي