本文整理汇总了C#中SpanTrackingMode类的典型用法代码示例。如果您正苦于以下问题:C# SpanTrackingMode类的具体用法?C# SpanTrackingMode怎么用?C# SpanTrackingMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpanTrackingMode类属于命名空间,在下文中一共展示了SpanTrackingMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTrackingSpan
public ITrackingSpan CreateTrackingSpan(Span span, SpanTrackingMode trackingMode, TrackingFidelityMode trackingFidelity) {
if (trackingMode == SpanTrackingMode.Custom)
throw new NotSupportedException();
if (trackingFidelity == TrackingFidelityMode.UndoRedo)
throw new NotSupportedException();
return new TrackingSpan(this, span, trackingMode, trackingFidelity);
}
示例2: MappingSpan
public MappingSpan(IBufferGraph bufferGraph, SnapshotSpan snapshotSpan, SpanTrackingMode trackingMode) {
if (bufferGraph == null)
throw new ArgumentNullException(nameof(bufferGraph));
if (snapshotSpan.Snapshot == null)
throw new ArgumentException();
BufferGraph = bufferGraph;
this.snapshotSpan = snapshotSpan;
spanTrackingMode = trackingMode;
}
示例3: TrackingSpanMock
public TrackingSpanMock(ITextBuffer textBuffer, Span span, SpanTrackingMode trackingMode, TrackingFidelityMode trackingFidelity)
{
_span = span;
TextBuffer = textBuffer;
TrackingMode = trackingMode;
TrackingFidelity = trackingFidelity;
var mock = textBuffer as TextBufferMock;
mock.BeforeChanged += OnBeforeTextBufferChanged;
}
示例4: TrackingSpan
public TrackingSpan(ITextVersion textVersion, Span span, SpanTrackingMode trackingMode, TrackingFidelityMode trackingFidelity) {
if (textVersion == null)
throw new ArgumentNullException(nameof(textVersion));
if ((uint)span.End > (uint)textVersion.Length)
throw new ArgumentOutOfRangeException(nameof(span));
TextBuffer = textVersion.TextBuffer;
TrackingFidelity = trackingFidelity;
TrackingMode = trackingMode;
this.textVersion = textVersion;
this.span = span;
}
示例5: MapTo
private static SnapshotSpan MapTo(IBufferGraphFactoryService bufferGraphFactoryService, SnapshotSpan span, ITextSnapshot snapshot, SpanTrackingMode spanTrackingMode)
{
if (span.Snapshot.TextBuffer == snapshot.TextBuffer)
return span.TranslateTo(snapshot, spanTrackingMode);
var graph = bufferGraphFactoryService.CreateBufferGraph(snapshot.TextBuffer);
var mappingSpan = graph.CreateMappingSpan(span, spanTrackingMode);
var mapped = mappingSpan.GetSpans(snapshot);
if (mapped.Count == 1)
return mapped[0];
return new SnapshotSpan(mapped[0].Start, mapped[mapped.Count - 1].End);
}
示例6: VersionedTextSpan
/// <summary>
/// Initializes a new instance of the <see cref="VersionedTextSpan"/> class.
/// </summary>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="buffer"/> is <see langword="null"/>.</para>
/// -or-
/// <para><paramref name="span"/> is <see langword="null"/>.</para>
/// </exception>
public VersionedTextSpan(TextBuffer buffer, Span span, SpanTrackingMode trackingMode)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (span == null)
{
throw new ArgumentNullException("span");
}
this.Construct(buffer, buffer.Version, span.Start, span.Length, trackingMode);
}
示例7: MockTrackingSpan
public MockTrackingSpan(MockTextSnapshot snapshot, int start, int length, SpanTrackingMode trackingMode = SpanTrackingMode.EdgeExclusive) {
_start = start;
_length = length;
_snapshot = snapshot;
_trackingMode = trackingMode;
switch(_trackingMode) {
case SpanTrackingMode.EdgeExclusive:
_startPoint = new MockTrackingPoint(snapshot, start, PointTrackingMode.Positive);
_endPoint = new MockTrackingPoint(snapshot, start + length, PointTrackingMode.Negative);
break;
case SpanTrackingMode.EdgeInclusive:
_startPoint = new MockTrackingPoint(snapshot, start, PointTrackingMode.Negative);
_endPoint = new MockTrackingPoint(snapshot, start + length, PointTrackingMode.Positive);
break;
case SpanTrackingMode.EdgeNegative:
_startPoint = new MockTrackingPoint(snapshot, start, PointTrackingMode.Negative);
_endPoint = new MockTrackingPoint(snapshot, start + length, PointTrackingMode.Negative);
break;
case SpanTrackingMode.EdgePositive:
_startPoint = new MockTrackingPoint(snapshot, start, PointTrackingMode.Positive);
_endPoint = new MockTrackingPoint(snapshot, start + length, PointTrackingMode.Positive);
break;
}
}
示例8: MapUpToSnapshot
public NormalizedSnapshotSpanCollection MapUpToSnapshot(SnapshotSpan span, SpanTrackingMode trackingMode, ITextSnapshot targetSnapshot) {
throw new NotImplementedException();
}
示例9: CreateTrackingSpan
public ITrackingSpan CreateTrackingSpan(Span span, SpanTrackingMode trackingMode) {
return new MockTrackingSpan(this, span.Start, span.Length);
}
示例10: CreateTrackingSpan
public ITrackingSpan CreateTrackingSpan(int start, int length, SpanTrackingMode trackingMode)
{
return TextBuffer.CurrentSnapshot.CreateTrackingSpan(start, length, trackingMode);
}
示例11: CreateTrackingSpan
public ITrackingSpan CreateTrackingSpan(int start, int length, SpanTrackingMode trackingMode, TrackingFidelityMode trackingFidelity) =>
Version.CreateTrackingSpan(start, length, trackingMode, trackingFidelity);
示例12: MapDownToFirstMatch
public NormalizedSnapshotSpanCollection MapDownToFirstMatch(SnapshotSpan span, SpanTrackingMode trackingMode, Predicate<ITextSnapshot> match) {
throw new NotImplementedException();
}
示例13: CreateMappingSpan
public IMappingSpan CreateMappingSpan(SnapshotSpan span, SpanTrackingMode trackingMode) {
throw new NotImplementedException();
}
示例14: Construct
private void Construct(TextBuffer buffer, ITextVersion version, Int32 start, Int32 length, SpanTrackingMode trackingMode)
{
Int32 lengthOfVersion = buffer.GetLengthOfVersion(version);
if ((start < 0) || (start > lengthOfVersion))
{
throw new ArgumentOutOfRangeException("start");
}
if ((length < 0) || ((start + length) > lengthOfVersion))
{
throw new ArgumentOutOfRangeException("length");
}
_buffer = buffer;
_version = version;
_start = start;
_length = length;
_trackingMode = trackingMode;
}
示例15: MapDownToBuffer
public NormalizedSnapshotSpanCollection MapDownToBuffer(SnapshotSpan span, SpanTrackingMode trackingMode, ITextBuffer targetBuffer) {
throw new NotImplementedException();
}