Freigeben über


IReadOnlyRegionEdit.CreateDynamicReadOnlyRegion Method

Definition

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.

public:
 Microsoft::VisualStudio::Text::IReadOnlyRegion ^ CreateDynamicReadOnlyRegion(Microsoft::VisualStudio::Text::Span span, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode, Microsoft::VisualStudio::Text::EdgeInsertionMode edgeInsertionMode, Microsoft::VisualStudio::Text::DynamicReadOnlyRegionQuery ^ callback);
public:
 Microsoft::VisualStudio::Text::IReadOnlyRegion ^ CreateDynamicReadOnlyRegion(Microsoft::VisualStudio::Text::Span span, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode, Microsoft::VisualStudio::Text::EdgeInsertionMode edgeInsertionMode, Microsoft::VisualStudio::Text::DynamicReadOnlyRegionQuery ^ callback);
public Microsoft.VisualStudio.Text.IReadOnlyRegion CreateDynamicReadOnlyRegion (Microsoft.VisualStudio.Text.Span span, Microsoft.VisualStudio.Text.SpanTrackingMode trackingMode, Microsoft.VisualStudio.Text.EdgeInsertionMode edgeInsertionMode, Microsoft.VisualStudio.Text.DynamicReadOnlyRegionQuery callback);
abstract member CreateDynamicReadOnlyRegion : Microsoft.VisualStudio.Text.Span * Microsoft.VisualStudio.Text.SpanTrackingMode * Microsoft.VisualStudio.Text.EdgeInsertionMode * Microsoft.VisualStudio.Text.DynamicReadOnlyRegionQuery -> Microsoft.VisualStudio.Text.IReadOnlyRegion
Public Function CreateDynamicReadOnlyRegion (span As Span, trackingMode As SpanTrackingMode, edgeInsertionMode As EdgeInsertionMode, callback As DynamicReadOnlyRegionQuery) As IReadOnlyRegion

Parameters

span
Span

The span to mark as read-only.

trackingMode
SpanTrackingMode

Specifies the tracking behavior of the read-only region.

edgeInsertionMode
EdgeInsertionMode

Specifies the edge insertion behavior of the read-only region.

callback
DynamicReadOnlyRegionQuery

The delegate that notifies the read-only region of read-only checks and edits. May be null. See QueryCallback.

Returns

The IReadOnlyRegion used to track this read-only region. This object will be used to remove the read-only region.

Exceptions

span is null.

span is past the end of the buffer.

Remarks

Zero-length read-only regions restrict inserts only at that point. A deletion or modification over that span can still occur.

Applies to