IReadOnlyRegionEdit.CreateReadOnlyRegion Method (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.
Namespace: Microsoft.VisualStudio.Text
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'Declaration
Function CreateReadOnlyRegion ( _
span As Span, _
trackingMode As SpanTrackingMode, _
edgeInsertionMode As EdgeInsertionMode _
) As IReadOnlyRegion
IReadOnlyRegion CreateReadOnlyRegion(
Span span,
SpanTrackingMode trackingMode,
EdgeInsertionMode edgeInsertionMode
)
IReadOnlyRegion^ CreateReadOnlyRegion(
Span span,
SpanTrackingMode trackingMode,
EdgeInsertionMode edgeInsertionMode
)
abstract CreateReadOnlyRegion :
span:Span *
trackingMode:SpanTrackingMode *
edgeInsertionMode:EdgeInsertionMode -> IReadOnlyRegion
function CreateReadOnlyRegion(
span : Span,
trackingMode : SpanTrackingMode,
edgeInsertionMode : EdgeInsertionMode
) : IReadOnlyRegion
Parameters
span
Type: Microsoft.VisualStudio.Text.SpanThe span to mark as read-only.
trackingMode
Type: Microsoft.VisualStudio.Text.SpanTrackingModeSpecifies the tracking behavior of the read-only region.
edgeInsertionMode
Type: Microsoft.VisualStudio.Text.EdgeInsertionModeSpecifies the edge insertion behavior of the read-only region.
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.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | span is null. |
ArgumentOutOfRangeException | span is past the end of the buffer. |
Remarks
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.