Aracılığıyla paylaş


IReadOnlyRegionEdit Interface

Definition

Provides for an atomic set of read-only region editing operations on an ITextBuffer. Edition positions are specified with respect to the state of the ITextBuffer at the time the IReadOnlyRegionEdit object was created.

public interface class IReadOnlyRegionEdit : IDisposable, Microsoft::VisualStudio::Text::ITextBufferEdit
public interface IReadOnlyRegionEdit : IDisposable, Microsoft.VisualStudio.Text.ITextBufferEdit
type IReadOnlyRegionEdit = interface
    interface ITextBufferEdit
    interface IDisposable
Public Interface IReadOnlyRegionEdit
Implements IDisposable, ITextBufferEdit
Implements

Remarks

At most one ITextBufferEdit object may be active for a particular ITextBuffer. It is considered active as long as it has been neither applied nor canceled; calling Dispose() on an unapplied object is equivalent to calling Cancel.

The operations performed using this object do not appear in the ITextBuffer until the Apply() method has been called.

Properties

Canceled

Determines whether this edit has been canceled.

(Inherited from ITextBufferEdit)
Snapshot

A snapshot of the ITextBuffer at the time this ITextBufferEdit object was created.

(Inherited from ITextBufferEdit)

Methods

Apply()

Commits all the modifications made with this ITextBufferEdit object to the underlying ITextBuffer. Depending on the type of edit, it may also cause the ITextBuffer to generate a new snapshot and raise its Changed event if any modifications were made. This method may be called only once. After it is called, any other calls on this object (other than Dispose) will result in an InvalidOperationException.

(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(Span, SpanTrackingMode, EdgeInsertionMode, DynamicReadOnlyRegionQuery)

Marks a span of text in this buffer as 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, 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.

CreateReadOnlyRegion(Span)

Marks a span of text in this buffer as read-only. The span remains read-only until the IReadOnlyRegion is removed.

RemoveReadOnlyRegion(IReadOnlyRegion)

Removes the read-only region from the list of read-only regions in this buffer.

Applies to