Compartilhar via


EditPoint Interface

Definition

Allows you to manipulate text as data in text buffers.

public interface class EditPoint : EnvDTE::TextPoint
public interface class EditPoint : EnvDTE::TextPoint
__interface EditPoint : EnvDTE::TextPoint
[System.Runtime.InteropServices.Guid("C1FFE800-028B-4475-A907-14F51F19BB7D")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface EditPoint : EnvDTE.TextPoint
[<System.Runtime.InteropServices.Guid("C1FFE800-028B-4475-A907-14F51F19BB7D")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type EditPoint = interface
    interface TextPoint
Public Interface EditPoint
Implements TextPoint
Derived
Attributes
Implements

Examples

Sub EditPointExample()  
  ' Before running this example, open a text document.  
  Dim objTD As TextDocument  
  Dim objEP As EditPoint  

  objTD = DTE.ActiveDocument.Object("TextDocument")  
  objEP = objTD.StartPoint.CreateEditPoint  
  objEP.Insert "Hello"  
End Sub  

Remarks

EditPoint objects are similar to TextSelection objects, except that they operate on data in the text buffer rather than on text displayed in a code editor. The difference is that text in the buffer is not affected by global editor states, such as word wrapping and virtual spaces.

Any operation that attempts to modify a text document fails if it affects any characters that are contained in a read-only block, or if the document itself is read-only.

Properties

AbsoluteCharOffset

Gets the one-based character offset of the EditPoint object.

AtEndOfDocument

Gets a value indicating whether or not the object is at the end of the document.

AtEndOfLine

Gets a value indicating whether or not the object is at the end of a line.

AtStartOfDocument

Gets a value indicating whether or not the object is at the beginning of the document.

AtStartOfLine

Gets a value indicating whether or not the EditPoint object is at the beginning of a line.

CodeElement[vsCMElement]

Gets the code element at the EditPoint location.

DisplayColumn

Gets the number of the column number of the EditPoint object.

DTE

Gets the top-level extensibility object.

Line

Gets the EditPoint object's line number.

LineCharOffset

Gets the character offset of the EditPoint object.

LineLength

Gets the number of characters in a line.

Parent

Gets the immediate parent object of the EditPoint object.

Methods

ChangeCase(Object, vsCaseOptions)

Changes the case of the selected text.

CharLeft(Int32)

Moves the edit point the specified number of characters to the left.

CharRight(Int32)

Moves the edit point the specified number of characters to the right.

ClearBookmark()

Clears any unnamed bookmarks in the current text buffer line.

Copy(Object, Boolean)

Copies the specified range of text to the clipboard.

CreateEditPoint()

Creates and returns an EditPoint object at the location of the calling object.

Cut(Object, Boolean)

Copies the specified range of text to the clipboard and deletes it from the document.

Delete(Object)

Deletes the specified range of text.

DeleteWhitespace(vsWhitespaceOptions)

Deletes the empty characters (white space) horizontally or vertically around the current location in the text buffer.

EndOfDocument()

Moves the edit point to the end of the document.

EndOfLine()

Moves the edit point to the end of the current line in the buffer.

EqualTo(TextPoint)

Returns a value indicating whether the value of the given point object's AbsoluteCharOffset is equal to that of the calling EditPoint object.

FindPattern(String, Int32, EditPoint, TextRanges)

Finds a given matching pattern in the selected text. This API has been deprecated in VS 2022 and above. Please refer the breaking API changes in VS 2022 for guidance on how to migrate API usage via modern find and repalce APIs.

GetLines(Int32, Int32)

Gets a string representing the text between two given lines.

GetText(Object)

Gets the text between the current location and the specified location in the buffer.

GreaterThan(TextPoint)

Returns whether the value of the EditPoint object's AbsoluteCharOffset property is greater than that of the given TextPoint object.

Indent(TextPoint, Int32)

Indents the selected lines by the given number of indentation levels.

Insert(String)

Inserts the given string at the edit point's current position in the buffer.

InsertFromFile(String)

Inserts the contents of the specified file at the current location in the buffer.

LessThan(TextPoint)

Returns whether the value of the called EditPoint object's AbsoluteCharOffset is less than that of the given TextPoint object.

LineDown(Int32)

Moves the edit point down the specified number of lines.

LineUp(Int32)

Moves the edit point up the specified number of lines.

MoveToAbsoluteOffset(Int32)

Moves the active point to the given 1-based absolute character offset.

MoveToLineAndOffset(Int32, Int32)

Moves the document to the specified line and character offset position in that line.

MoveToPoint(TextPoint)

Moves the active point to the given position.

NextBookmark()

Moves to the location of the next bookmark in the document.

OutlineSection(Object)

Creates an outlining section based on an edit point and the given text point or value.

PadToColumn(Int32)

Fills the current line in the buffer with empty characters (white space) to the given column.

Paste()

Inserts the clipboard contents at the current location.

PreviousBookmark()

Moves the edit point to the location of the previous bookmark in the document.

ReadOnly(Object)

Returns a value indicating whether any of the specified range contains read-only text.

ReplacePattern(TextPoint, String, String, Int32, TextRanges)

Finds a pattern in the specified range of text and replaces it with the specified text. This API has been deprecated in VS 2022 and above. Please refer the breaking API changes in VS 2022 for guidance on how to migrate API usage via modern find and repalce APIs.

ReplaceText(Object, String, Int32)

Replaces the selected text with the given text. This API has been deprecated in VS 2022 and above. Please refer the breaking API changes in VS 2022 for guidance on how to migrate API usage via modern find and repalce APIs.

SetBookmark()

Sets an unnamed bookmark on the current line in the buffer.

SmartFormat(TextPoint)

Formats the specified range of text based on the current language.

StartOfDocument()

Moves the object to the beginning of the document.

StartOfLine()

Moves the edit point to the beginning of the current line in the buffer.

TryToShow(vsPaneShowHow, Object)

Attempts to display the text point's location.

Unindent(TextPoint, Int32)

Removes the indent characters from the selected lines by the given number of indentation levels.

WordLeft(Int32)

Moves the object the specified number of words to the left.

WordRight(Int32)

Moves the object the specified number of words to the right.

Applies to