مشاركة عبر


TextPoint الواجهة

Represents a الموقع of نص في a مستند نصي.

مساحة الاسم:  EnvDTE
التجميع:  EnvDTE (في EnvDTE.dll)

بناء الجملة

'إقرار
<GuidAttribute("7F59E94E-4939-40D2-9F7F-B7651C25905D")> _
Public Interface TextPoint
[GuidAttribute("7F59E94E-4939-40D2-9F7F-B7651C25905D")]
public interface TextPoint
[GuidAttribute(L"7F59E94E-4939-40D2-9F7F-B7651C25905D")]
public interface class TextPoint
[<GuidAttribute("7F59E94E-4939-40D2-9F7F-B7651C25905D")>]
type TextPoint =  interface end
public interface TextPoint

ملاحظات

The TextPoint كائن allows you إلى بحث مواقع? في a مستند. Using the خصائص of the TextPoint كائن, you can بحث نص مع:

  • رقم السطر

  • حرف أرقام في a خط

  • مطلق حرف مواقع? من the beginning of the مستند

  • عرض أعمدة

TextPoint الكائنات are similar إلى EditPoint الكائنات, except that they operate تشغيل نص displayed في a تعليمات برمجية محرر rather than بيانات في the نص احتياطي. نص في a مستند هو affected بواسطة عمومي محرر states, such كـ الكلمة التفاف و ظاهري مسافات, but the نص احتياطي ليس.

كـ you تحرير a مستند, TextPoint الكائنات do not تحريك نسبي إلى their surrounding نص. That هو, if نص هو inserted قبل a نص يؤشر, then the القيمة of its AbsoluteCharOffset خاصية هو incremented إلى يعكس its الموقع جديد further أسفل في the مستند. إذا عدة TextPointوجود كائن في نفس الموقع EditPointالكائن هو المستخدمة لإدراج نص الجديد، ثم الجديدة كانت الأحرف الموجودة إلى اليمين من الجميع TextPointاستثناء الكائنات التي استخدمتها عند إدراج نص.

أي عملية محاولة تعديل TextDocumentفشل الكائن إذا كان TextDocumentهو القراءة فقط.

أمثلة

Sub TextPointExample()
   ' Comments a region of code.
   Dim selection As TextSelection
   selection = dte.ActiveDocument.selection()
   Dim Start As Editpoint
   Start = selection.TopPoint.CreateEditPoint()
   Dim endpt As TextPoint
   endpt = selection.BottomPoint
      
   Dim undoObj As UndoContext = dte.UndoContext
   undoobj.Open("Comment Region")
   Do While (Start.LessThan(endpt))
      Start.Insert("//")
      Start.LineDown()
      Start.StartOfLine()
   Loop
   undoobj.Close()
End Sub

راجع أيضًَا

المرجع

TextPoint الأعضاء

EnvDTE مساحة الاسم