IProjectionBuffer::InsertSpans Method (Int32, IList<Object^>^)
Inserts a list of ITrackingSpan objects and/or literal strings into the list of source spans in the order in which they appear in the list.
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Parameters
- position
-
Type:
System::Int32
The position at which to insert the spans.
- spansToInsert
-
Type:
System.Collections.Generic::IList<Object^>^
The list of spans to insert.
Return Value
Type: Microsoft.VisualStudio.Text.Projection::IProjectionSnapshot^| Exception | Condition |
|---|---|
| ArgumentNullException | spansToInsert is null or a span in that list is null. |
| ArgumentOutOfRangeException | position is less than zero or greater than the number of spans. |
| ArgumentException | An element of spansToInsert is neither an ITrackingSpan nor a string. -or- A span in spansToInsert would cause a duplicated projection. -or- A tracking span in spansToInsert is EdgeInclusive and does not cover its entire buffer, or is EdgePositive and does not abut the end of its buffer, or is EdgeNegative and does not abut the beginning of its buffer. These checks are not performed if the projection buffer was created with the PermissiveEdgeInclusiveSourceSpans option. -or- Adding one of the text buffers containing any of the spansToInsert would create a cycle among a set of projection buffers. |