IReadOnlyRegionEdit Interface
Represents a set of read-only region editing operations (creating and removing read-only regions on an ITextBuffer.
Namespace: Microsoft.VisualStudio.Text
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'宣言
Public Interface IReadOnlyRegionEdit _
Inherits ITextBufferEdit, IDisposable
public interface IReadOnlyRegionEdit : ITextBufferEdit,
IDisposable
public interface class IReadOnlyRegionEdit : ITextBufferEdit,
IDisposable
type IReadOnlyRegionEdit =
interface
interface ITextBufferEdit
interface IDisposable
end
public interface IReadOnlyRegionEdit extends ITextBufferEdit, IDisposable
The IReadOnlyRegionEdit type exposes the following members.
Properties
Name | Description | |
---|---|---|
Canceled | Determines whether this edit has been canceled. (Inherited from ITextBufferEdit.) | |
Snapshot | Gets a snapshot of the ITextBuffer at the time this object was created. (Inherited from ITextBufferEdit.) |
Top
Methods
Name | Description | |
---|---|---|
Apply | Commits all the modifications made with this ITextBufferEdit object to the underlying ITextBuffer. It also causes the ITextBuffer to generate a new snapshot and raise its Changed event if any modifications were made. (Inherited from ITextBufferEdit.) | |
Cancel | Abandons all modifications started using this ITextBufferEdit object. Any further calls on this object will result in an InvalidOperationException. (Inherited from ITextBufferEdit.) | |
CreateDynamicReadOnlyRegion | Marks a span of text in this buffer as conditionally read-only, subject to a check performed when the region is queried. The span remains read-only until it is marked as writable or forced writable again. | |
CreateReadOnlyRegion(Span) | Marks a span of text in this buffer as read-only. The span remains read-only until the IReadOnlyRegion is removed. | |
CreateReadOnlyRegion(Span, SpanTrackingMode, EdgeInsertionMode) | Marks a span of text in this buffer as read-only. The span remains read-only until it is marked as writable or forced writable again. | |
Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.) | |
RemoveReadOnlyRegion | Removes the read-only region from the list of read-only regions in this buffer. |
Top
Remarks
Editing positions are specified with respect to the state of the ITextBuffer at the time the IReadOnlyRegionEdit object was created.
At most one ITextBufferEdit object (including IReadOnlyRegionEdit objects) may be active at a given time for a particular ITextBuffer. A IReadOnlyRegionEdit is active as long as it has been neither applied nor canceled. Calling Dispose() on an unapplied IReadOnlyRegionEdit is equivalent to calling Cancel().
The operations performed using this object do not appear in the ITextBuffer until the Apply method has been called.