예제 #1
0
        public virtual PipelineWrapper AddDebugProcessor(string group, string name, int index)
        {
            //Create a core processor
            var config        = BaseFactory.GetConfigNode("pipelines/pipelineDebug/processor");
            var coreProcessor = new CoreProcessor();

            coreProcessor.Initialize(config);

            //Initialize it so we can add settings
            var debugProcessor = ReflectionService.InitializeDebugProcessor(coreProcessor);

            debugProcessor.PipelineGroup = group;
            debugProcessor.PipelineName  = name;
            debugProcessor.PipelineIndex = index;
            debugProcessor.Taxonomies    = SettingsService.DefaultTaxonomies;

            //Add it to our simple pipeline
            var pipeline           = GetPipeline(group, name);
            var processorReference = new ProcessorWrapper(coreProcessor, pipeline, debugProcessor);

            pipeline.Processors.Insert(index, processorReference);
            ProcessorMap.Add(debugProcessor.Id, processorReference);

            //Set the result as the active processors
            ReflectionService.SetProcessors(pipeline.CorePipeline, pipeline.Processors.Select(wrapper => wrapper.CoreProcessor).ToArray());
            RefreshProcessorIndexes(pipeline);

            return(pipeline);
        }