Freigeben über


IReadOnlyRegionEdit.CreateReadOnlyRegion Method

Definition

Overloads

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.

CreateReadOnlyRegion(Span)

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

public:
 Microsoft::VisualStudio::Text::IReadOnlyRegion ^ CreateReadOnlyRegion(Microsoft::VisualStudio::Text::Span span);
public:
 Microsoft::VisualStudio::Text::IReadOnlyRegion ^ CreateReadOnlyRegion(Microsoft::VisualStudio::Text::Span span);
Microsoft::VisualStudio::Text::IReadOnlyRegion CreateReadOnlyRegion(Microsoft::VisualStudio::Text::Span span);
public Microsoft.VisualStudio.Text.IReadOnlyRegion CreateReadOnlyRegion (Microsoft.VisualStudio.Text.Span span);
abstract member CreateReadOnlyRegion : Microsoft.VisualStudio.Text.Span -> Microsoft.VisualStudio.Text.IReadOnlyRegion
Public Function CreateReadOnlyRegion (span As Span) As IReadOnlyRegion

Parameters

span
Span

The span to mark as read-only.

Returns

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

Exceptions

span is null.

span is past the end of the buffer.

Remarks

Insertions at the edge of the read-only region are allowed by default.

Applies to

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.

public:
 Microsoft::VisualStudio::Text::IReadOnlyRegion ^ CreateReadOnlyRegion(Microsoft::VisualStudio::Text::Span span, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode, Microsoft::VisualStudio::Text::EdgeInsertionMode edgeInsertionMode);
public:
 Microsoft::VisualStudio::Text::IReadOnlyRegion ^ CreateReadOnlyRegion(Microsoft::VisualStudio::Text::Span span, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode, Microsoft::VisualStudio::Text::EdgeInsertionMode edgeInsertionMode);
Microsoft::VisualStudio::Text::IReadOnlyRegion CreateReadOnlyRegion(Microsoft::VisualStudio::Text::Span span, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode, Microsoft::VisualStudio::Text::EdgeInsertionMode edgeInsertionMode);
public Microsoft.VisualStudio.Text.IReadOnlyRegion CreateReadOnlyRegion (Microsoft.VisualStudio.Text.Span span, Microsoft.VisualStudio.Text.SpanTrackingMode trackingMode, Microsoft.VisualStudio.Text.EdgeInsertionMode edgeInsertionMode);
abstract member CreateReadOnlyRegion : Microsoft.VisualStudio.Text.Span * Microsoft.VisualStudio.Text.SpanTrackingMode * Microsoft.VisualStudio.Text.EdgeInsertionMode -> Microsoft.VisualStudio.Text.IReadOnlyRegion
Public Function CreateReadOnlyRegion (span As Span, trackingMode As SpanTrackingMode, edgeInsertionMode As EdgeInsertionMode) 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.

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