public ResultsUpdater(ResultsEditorExtension ext, IEnumerable <Result> results, object resultsId, CancellationToken cancellationToken)
            {
                if (ext == null)
                {
                    throw new ArgumentNullException("ext");
                }
                if (results == null)
                {
                    throw new ArgumentNullException("results");
                }
                this.ext = ext;
                id       = resultsId;
                this.cancellationToken = cancellationToken;

                Queue <IGenericTextSegmentMarker> oldMarkers;

                if (resultsId != null)
                {
                    if (!ext.markers.TryGetValue(id, out oldMarkers))
                    {
                        ext.markers [id] = oldMarkers = new Queue <IGenericTextSegmentMarker> ();
                    }
                    this.oldMarkers = oldMarkers.Count;
                }

                builder = ImmutableArray <QuickTask> .Empty.ToBuilder();

                enumerator = results.GetEnumerator();
            }
Exemple #2
0
            public ResultsUpdater(ResultsEditorExtension ext, IReadOnlyList <Result> results, object resultsId, CancellationToken cancellationToken)
            {
                if (ext == null)
                {
                    throw new ArgumentNullException("ext");
                }
                if (results == null)
                {
                    throw new ArgumentNullException("results");
                }
                this.ext = ext;
                id       = resultsId;
                this.cancellationToken = cancellationToken;

                if (resultsId != null)
                {
                    if (!ext.markers.TryGetValue(id, out oldMarkers))
                    {
                        ext.markers [id] = oldMarkers = GetCachedList();
                    }
                }

                builder = ImmutableArray <QuickTask> .Empty.ToBuilder();

                this.results = results;
                newMarkers   = GetCachedList();
            }
Exemple #3
0
 public ResultsUpdater(ResultsEditorExtension ext, IEnumerable <Result> results, CancellationToken cancellationToken)
 {
     if (ext == null)
     {
         throw new ArgumentNullException("ext");
     }
     if (results == null)
     {
         throw new ArgumentNullException("results");
     }
     this.ext = ext;
     this.cancellationToken = cancellationToken;
     this.oldMarkers        = ext.markers.Count;
     enumerator             = ((IEnumerable <Result>)results).GetEnumerator();
 }
			public ResultsUpdater (ResultsEditorExtension ext, IEnumerable<Result> results, CancellationToken cancellationToken)
			{
				if (ext == null)
					throw new ArgumentNullException ("ext");
				if (results == null)
					throw new ArgumentNullException ("results");
				this.ext = ext;
				this.cancellationToken = cancellationToken;
				this.oldMarkers = ext.markers.Count;
				enumerator = ((IEnumerable<Result>)results).GetEnumerator ();
			}