مشاركة عبر


EditPoint.Cut أسلوب

النسخ the specified range of نص إلى the حافظة و deletes it من the مستند.

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

بناء الجملة

'إقرار
Sub Cut ( _
    PointOrCount As Object, _
    Append As Boolean _
)
void Cut(
    Object PointOrCount,
    bool Append
)
void Cut(
    [InAttribute] Object^ PointOrCount, 
    [InAttribute] bool Append
)
abstract Cut : 
        PointOrCount:Object * 
        Append:bool -> unit 
function Cut(
    PointOrCount : Object, 
    Append : boolean
)

المعلمات

  • PointOrCount
    النوع: System.Object
    مطلوبة.أما على TextPointالكائن أو عدد حرف/ حروف.
  • Append
    النوع: System.Boolean
    اختياري.Indicates whether إلى append the محدد نص إلى the حافظة.يكون الإعداد الافتراضي هو false.

ملاحظات

If PointOrCount هو a TextPoint كائن, Cut cuts the نص between the تحرير يؤشر و PointOrCount و places it تشغيل the حافظة. إذا كان PointOrCountعدد صحيح، ثم Cutقص النص بعد نقطة التحرير للمحدد عدد الأحرف اتباع نقطة التحرير (إضافة واحدة لكل تسلسل السطر الجديد ضمني في نهاية كل سطر). If PointOrCount هو negative, then Cut cuts نص قبل the تحرير يؤشر.

If Append هو true, then Cut appends the تحديد إلى the الحالي حافظة المحتويات rather than replacing it.

أمثلة

Sub CutExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")
        
   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
       
   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objeditpt.Insert("This is a test." & Chr(13))
   Next iCtr
        
   ' Copies the fourth word of the fourth line and pastes it, 
   ' then cuts the fourth word of the eighth line.
   objEditPt.StartOfDocument()
   objEditPt.LineDown(3)
   objEditPt.WordRight(3)
   objEditPt.Copy(4)
   objEditPt.Paste()
   objEditPt.LineDown(3)
   objEditPt.WordRight(3)
   objEditPt.Cut(4)
End Sub

أمن NET Framework.

راجع أيضًَا

المرجع

EditPoint واجهة

EditPoint الأعضاء

EnvDTE مساحة الاسم