مشاركة عبر


EditPoint.Copy أسلوب

النسخ the specified range of نص إلى the حافظة.

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

بناء الجملة

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

المعلمات

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

ملاحظات

If the وسيطة هو a TextPoint كائن, Copy النسخ a سلسلة representing the نص between the تحرير يؤشر و PointOrCount. إذا كانت الوسيطة هو عددا صحيحاً، ثم Copyنسخ سلسلة أحرف يمثل عدد محدد من الأحرف التي تتبع النقطة التحرير (حساب واحد لكل تسلسل السطر الجديد ضمني في نهاية كل سطر). If PointOrCount هو negative, then Copy النسخ نص قبل the تحرير يؤشر rather than بعد.

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

أمثلة

Sub CopyExample()
   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 مساحة الاسم