コード例 #1
0
 private void Check(string pipeline, bool phaseChecks = true)
 {
     Check();
     if (string.IsNullOrEmpty(pipeline))
     {
         throw new ArgumentException(nameof(pipeline));
     }
     if (!_pipelines.ContainsKey(pipeline))
     {
         throw new KeyNotFoundException($"The pipeline {pipeline} could not be found");
     }
     if (_pipelines[pipeline].Isolated)
     {
         throw new InvalidOperationException($"Cannot access documents in isolated pipeline {pipeline}");
     }
     if (phaseChecks && _pipelinePhase.Phase == Phase.Process)
     {
         if (pipeline.Equals(_pipelinePhase.PipelineName, StringComparison.OrdinalIgnoreCase))
         {
             throw new InvalidOperationException($"Cannot access documents from currently executing pipeline {pipeline} while in the {nameof(Phase.Process)} phase");
         }
         if (!GatherProcessPhaseDependencies(_pipelinePhase).Contains(pipeline))
         {
             throw new InvalidOperationException($"Cannot access documents from pipeline {pipeline} without a dependency while in the {nameof(Phase.Process)} phase");
         }
     }
 }
コード例 #2
0
        public static void AddIfNonExisting(this IPipelineCollection pipelineCollection, IPipeline pipeline)
        {
            string name = (pipeline as INamedPipeline)?.PipelineName ?? pipeline?.GetType().Name;

            if (!pipelineCollection.ContainsKey(name))
            {
                pipelineCollection.Add(name, pipeline);
            }
        }
コード例 #3
0
 /// <summary>
 /// Validates the pipeline name argument.
 /// </summary>
 private void ValidateArguments(string pipelineName)
 {
     if (string.IsNullOrEmpty(pipelineName))
     {
         throw new ArgumentException(nameof(pipelineName));
     }
     if (!_pipelines.ContainsKey(pipelineName))
     {
         throw new KeyNotFoundException($"The pipeline {pipelineName} could not be found");
     }
 }
コード例 #4
0
 private void Check(string pipelineName, bool pipelineChecks = true)
 {
     CheckCurrentPhase();
     if (string.IsNullOrEmpty(pipelineName))
     {
         throw new ArgumentException(nameof(pipelineName));
     }
     if (!_pipelines.ContainsKey(pipelineName))
     {
         throw new KeyNotFoundException($"The pipeline {pipelineName} could not be found");
     }
     if (pipelineChecks)
     {
         if (!_phaseResults.TryGetValue(pipelineName, out PhaseResult[] phaseResults))