//FIXME: rate-limit this, so we don't send multiple new documents while it's processing void OnDocumentParsed(object sender, EventArgs args) { if (!QuickTaskStrip.EnableFancyFeatures) { return; } var doc = Document.ParsedDocument; if (doc == null) { return; } if (src != null) { src.Cancel(); try { oldTask.Wait(); } catch (AggregateException ex) { ex.Handle(e => e is TaskCanceledException); } } src = new CancellationTokenSource(); var treeType = new RuleTreeType("Document", Path.GetExtension(doc.FileName)); var task = AnalysisService.QueueAnalysis(Document, treeType, src.Token); oldTask = task.ContinueWith(t => new ResultsUpdater(this, t.Result, src.Token).Update(), src.Token); }
//FIXME: rate-limit this, so we don't send multiple new documents while it's processing void OnDocumentParsed(object sender, EventArgs args) { var doc = Document.ParsedDocument; var treeType = new RuleTreeType("ParsedDocument", Path.GetExtension(doc.FileName)); AnalysisService.QueueAnalysis(doc, treeType, UpdateResults); }
//FIXME: rate-limit this, so we don't send multiple new documents while it's processing void OnDocumentParsed(object sender, EventArgs args) { try { var doc = this.Document; if (doc == null || string.IsNullOrEmpty(Path.GetExtension(doc.FileName))) { return; } var treeType = new RuleTreeType("Document", Path.GetExtension(doc.FileName)); AnalysisService.QueueAnalysis(doc, treeType, UpdateResults); } catch (NullReferenceException nre) { MonoDevelop.Core.LoggingService.LogError("NRE in OnDocumentParsed", nre); } }
//FIXME: rate-limit this, so we don't send multiple new documents while it's processing void OnDocumentParsed(object sender, EventArgs args) { if (!QuickTaskStrip.EnableFancyFeatures) { return; } var doc = Document.ParsedDocument; if (doc == null) { return; } lock (this) { CancelTask(); src = new CancellationTokenSource(); var treeType = new RuleTreeType("Document", Path.GetExtension(doc.FileName)); var task = AnalysisService.QueueAnalysis(Document, treeType, src.Token); oldTask = task.ContinueWith(t => new ResultsUpdater(this, t.Result, src.Token).Update(), src.Token); } }
//FIXME: rate-limit this, so we don't send multiple new documents while it's processing void OnDocumentParsed (object sender, EventArgs args) { if (!QuickTaskStrip.EnableFancyFeatures) return; var doc = Document.ParsedDocument; if (doc == null) return; lock (this) { CancelTask (); src = new CancellationTokenSource (); var treeType = new RuleTreeType ("Document", Path.GetExtension (doc.FileName)); var task = AnalysisService.QueueAnalysis (Document, treeType, src.Token); oldTask = task.ContinueWith (t => new ResultsUpdater (this, t.Result, src.Token).Update (), src.Token); } }
//FIXME: rate-limit this, so we don't send multiple new documents while it's processing void OnDocumentParsed (object sender, EventArgs args) { try { var doc = this.Document; if (doc == null || string.IsNullOrEmpty (Path.GetExtension (doc.FileName))) return; var treeType = new RuleTreeType("Document", Path.GetExtension(doc.FileName)); AnalysisService.QueueAnalysis(doc, treeType, UpdateResults); } catch (NullReferenceException nre) { MonoDevelop.Core.LoggingService.LogError("NRE in OnDocumentParsed", nre); } }
//FIXME: rate-limit this, so we don't send multiple new documents while it's processing void OnDocumentParsed (object sender, EventArgs args) { var doc = Document.ParsedDocument; if (doc == null) return; var treeType = new RuleTreeType ("Document", Path.GetExtension (doc.FileName)); AnalysisService.QueueAnalysis (Document, treeType, UpdateResults); }