ITextEdit 介面
表示 ITextBuffer 上的一組編輯作業。
命名空間: Microsoft.VisualStudio.Text
組件: Microsoft.VisualStudio.Text.Data (在 Microsoft.VisualStudio.Text.Data.dll 中)
語法
'宣告
Public Interface ITextEdit _
Inherits ITextBufferEdit, IDisposable
public interface ITextEdit : ITextBufferEdit,
IDisposable
public interface class ITextEdit : ITextBufferEdit,
IDisposable
type ITextEdit =
interface
interface ITextBufferEdit
interface IDisposable
end
public interface ITextEdit extends ITextBufferEdit, IDisposable
ITextEdit 類型會公開下列成員。
屬性
名稱 | 描述 | |
---|---|---|
Canceled | 判斷這個編輯是否已遭到取消。 (繼承自 ITextBufferEdit)。 | |
HasEffectiveChanges | 判斷編輯是否在非唯讀區域中造成變更。 | |
HasFailedChanges | 判斷是否有任何變更因為唯讀區域而無法加入至這個編輯。 | |
Snapshot | 取得快照的ITextBuffer在已建立此物件。 (繼承自 ITextBufferEdit)。 |
回頁首
方法
名稱 | 描述 | |
---|---|---|
Apply | 認可這個 ITextBufferEdit 物件執行的修改,並實施在基礎的 ITextBuffer 上。它也會造成ITextBuffer產生新的快照集,並引發其Changed事件,如果所做的任何修改。 (繼承自 ITextBufferEdit)。 | |
Cancel | 放棄所有以這個 ITextBufferEdit 物件起始的修改。之後每當呼叫這個物件時,將導致 InvalidOperationException。 (繼承自 ITextBufferEdit)。 | |
Delete(Span) | 從緩衝區中刪除一連串字元。 | |
Delete(Int32, Int32) | 從緩衝區中刪除一連串字元。 | |
Dispose | 執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。 (繼承自 IDisposable)。 | |
Insert(Int32, String) | 在文字緩衝區中的指定 position 處插入指定的 text。 | |
Insert(Int32, array<Char[], Int32, Int32) | 插入字元陣列中指定位置處ITextBuffer。 | |
Replace(Span, String) | 將一連串字元取代成不同的文字。 | |
Replace(Int32, Int32, String) | 將一連串字元取代成不同的文字。 |
回頁首
備註
最多一個ITextBufferEdit在特定的時候,物件可能會使用ITextBuffer。
所有編輯作業之位置的指定會和 ITextBuffer 建立時的狀態相關。
這個物件會被視為使用中,只要經過不致於 Applied 或已取消。 未套用在物件上呼叫 Dispose 方法等於呼叫 [取消]。
使用這個物件來執行的作業不會反映在ITextBuffer才Apply在呼叫方法。
如需有關文字編輯的詳細資訊,請參閱"A 仔細看起來在文字模型和文字檢視"在在 [編輯器]。