/// <summary> /// Called by derived types to enqueue tags re-calculation request /// </summary> private void RecalculateTagsOnChanged(TaggerEventArgs e) { // First, cancel any previous requests (either still queued, or started). We no longer // want to continue it if new changes have come in. _workQueue.CancelCurrentWork(); RegisterNotification(RecomputeTagsForeground, (int)e.Delay.ComputeTimeDelay(_subjectBuffer).TotalMilliseconds, _workQueue.CancellationToken); }
private void OnEventSourceChanged(object sender, TaggerEventArgs e) { // First, cancel any previous requests (either still queued, or started). We no longer // want to continue it if new changes have come in. _workQueue.CancelCurrentWork(); RegisterNotification( () => RecomputeTagsForeground(initialTags: false, synchronous: false), (int)_dataSource.EventChangeDelay.ComputeTimeDelay().TotalMilliseconds, GetCancellationToken(initialTags: false)); }
private void OnUnderlyingSourceChanged(object?sender, TaggerEventArgs args) { // First, notify anyone listening to us that something definitely changed. this.Changed?.Invoke(this, args); var document = _subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); if (document == null) { return; } _eventSource.EnsureCompilationAvailability(document.Project, _onCompilationAvailable); }
private void OnEventSourceChanged(object sender, TaggerEventArgs e) { var result = Interlocked.CompareExchange(ref _seenEventSourceChanged, value: 1, comparand: 0); if (result == 0) { // this is the first time we're hearing about changes from our event-source. // Don't have any delay here. We want to just compute the tags and display // them as soon as we possibly can. ComputeInitialTags(); } else { // First, cancel any previous requests (either still queued, or started). We no longer // want to continue it if new changes have come in. _workQueue.CancelCurrentWork(); RegisterNotification( () => RecomputeTagsForeground(initialTags: false), (int)e.Delay.ComputeTimeDelay().TotalMilliseconds, GetCancellationToken(initialTags: false)); } }
private void OnEventSourceChanged(object sender, TaggerEventArgs _) => _eventWorkQueue.AddWork(/*initialTags*/ false);
private void OnChanged(object sender, TaggerEventArgs e) { RecalculateTagsOnChanged(e); }
private void OnEventSourceChanged(object?_1, TaggerEventArgs _2) { EnqueueWork(initialTags: false); }
private void OnEventSourceChanged(object?_1, TaggerEventArgs _2) => EnqueueWork(highPriority: false);
private void OnEventSourceChanged(object sender, TaggerEventArgs e) => RecalculateTagsOnChanged(e);