コード例 #1
0
        public IEnumerable <IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            Handler.Init();
            if (processKind != DaemonProcessKind.VISIBLE_DOCUMENT ||
                !IsSupported(process.SourceFile))
            {
                return(EmptyList <IDaemonStageProcess> .InstanceList);
            }

            var document = process.Document;

            if (!documentToProcess.ContainsKey(document))
            {
                var highlightingProcess = new HighlightingProcess(process, settings);
                documentToProcess.Add(process.Document, highlightingProcess);
            }
            else
            {
                documentToProcess[document].Update(process, settings);
            }

            return(new List <IDaemonStageProcess> {
                documentToProcess[document]
            });
        }
コード例 #2
0
        public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            Handler.Init();
            if (processKind != DaemonProcessKind.VISIBLE_DOCUMENT ||
                !IsSupported(process.SourceFile))
            {
                return EmptyList<IDaemonStageProcess>.InstanceList;
            }

            var document = process.Document;
            if (!documentToProcess.ContainsKey(document))
            {
                var highlightingProcess = new HighlightingProcess(process, settings);
                documentToProcess.Add(process.Document, highlightingProcess);
            }
            else
            {
                documentToProcess[document].Update(process, settings);
            }

            return new List<IDaemonStageProcess> { documentToProcess[document] };
        }