コード例 #1
0
        //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);
        }
コード例 #2
0
        //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);
        }
コード例 #3
0
        //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);
            }
        }
コード例 #4
0
        //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);
            }
        }
コード例 #5
0
		//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);
			}
		}
コード例 #6
0
		//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);
			}
		}
コード例 #7
0
		//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);
		}