Freigeben über


ITextDocumentEditor Interface

Definition

Exposes methods for changing an immutable ITextDocumentSnapshot instance.

public interface ITextDocumentEditor
type ITextDocumentEditor = interface
Public Interface ITextDocumentEditor

Remarks

You can acquire an instance of ITextDocumentEditor within the function passed to EditorExtensibility.EditAsync(System.Action<IEditBatch>, System.Threading.CancellationToken)

Properties

Document

The specific version of the ITextDocumentSnapshot that the edit(s) will be applied to, unless otherwise specified as part of a TextRange or TextPosition parameter.

Methods

Delete(TextRange)

Deletes the specified range of text from the document.

Insert(Int32, String)

Inserts the specified text at the specified position in the document.

Reload()

Reloads the document from disk.

Rename(String)

Renames Document to newFilePath.

Replace(TextRange, String)

Replaces the text within replaceRange with replaceWith.

Save()

Saves the contents of Document to disk.

SaveAs(String, Boolean, Boolean)

Saves the contents of Document to disk with the new filePath.

SaveAs(String, Boolean)

Saves the contents of Document to disk with the new filePath.

SaveCopy(String, Boolean, Boolean)

Saves the contents of Document to disk with the new filePath. Does not update the Uri of the underlying document, as used by subsequent Save()s.

SaveCopy(String, Boolean)

Saves the contents of Document to disk with the new filePath. Does not update the Uri of the underlying document, as used by subsequent Save()s.

Applies to