IReadOnlyRegionEdit::CreateDynamicReadOnlyRegion Method (Span, SpanTrackingMode, EdgeInsertionMode, DynamicReadOnlyRegionQuery^)
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.
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
IReadOnlyRegion^ CreateDynamicReadOnlyRegion( Span span, SpanTrackingMode trackingMode, EdgeInsertionMode edgeInsertionMode, DynamicReadOnlyRegionQuery^ callback )
Parameters
- span
-
Type:
Microsoft.VisualStudio.Text::Span
The span to mark as read-only.
- trackingMode
-
Type:
Microsoft.VisualStudio.Text::SpanTrackingMode
Specifies the tracking behavior of the read-only region.
- edgeInsertionMode
-
Type:
Microsoft.VisualStudio.Text::EdgeInsertionMode
Specifies the edge insertion behavior of the read-only region.
- callback
-
Type:
Microsoft.VisualStudio.Text::DynamicReadOnlyRegionQuery^
The delegate that notifies the read-only region of read-only checks and edits. May be null.
See QueryCallback.
Return Value
Type: Microsoft.VisualStudio.Text::IReadOnlyRegion^The IReadOnlyRegion used to track this read-only region. This object will be used to remove the read-only region.
| Exception | Condition |
|---|---|
| ArgumentNullException | span is null. |
| ArgumentOutOfRangeException | span is past the end of the buffer. |
Zero-length read-only regions restrict inserts only at the exact point defined by the region. A deletion or modification that includes that point can still occur.