public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll, out bool?output) { bool result = true; output = null; using (List <ITaskIOPipeline> .Enumerator enumerator = this.pipelines.GetEnumerator()) { while (enumerator.MoveNext()) { ITaskIOPipeline pipeline = enumerator.Current; string text = base.GetType().Name + ".ShouldContinue"; using (new CmdletMonitoredScope(this.context.UniqueId, "TaskModuleLatency", text, LoggerHelper.CmdletPerfMonitors)) { ICriticalFeature feature = pipeline as ICriticalFeature; bool yesToAllFromDelegate = yesToAll; bool noToAllFromDelegate = noToAll; bool? outputFromDelegate = output; feature.Execute(delegate { result = pipeline.ShouldContinue(query, caption, ref yesToAllFromDelegate, ref noToAllFromDelegate, out outputFromDelegate); }, this.context, text); yesToAll = yesToAllFromDelegate; noToAll = noToAllFromDelegate; output = outputFromDelegate; } if (!result) { break; } } } return(result); }
internal void PrependTaskIOPipelineHandler(ITaskIOPipeline pipeline) { this.pipelines.Insert(0, pipeline); }