public bool PipelineIsProgressPureFromLastPrtgCmdlet() { var commands = GetPipelineCommands(); var myIndex = commands.IndexOf(cmdlet); for (var i = myIndex - 1; i >= 0; i--) { if (commands[i] is PrtgCmdlet) { return(true); } if (!ProgressManager.IsPureThirdPartyCmdlet(commands[i].GetType())) { return(false); } } return(false); }
/// <summary> /// Indicates whether the current pipeline contains progress compatible cmdlets all the way to the next <see cref="PrtgCmdlet"/>. Returns false if there are no more <see cref="PrtgCmdlet"/> objects in the pipeline. /// </summary> /// <returns></returns> public bool PipelineIsProgressPureToNextPrtgCmdlet() { var commands = GetPipelineCommands(); var myIndex = commands.IndexOf(cmdlet); for (var i = myIndex + 1; i < commands.Count; i++) { if (commands[i] is PrtgProgressCmdlet || commands[i] is PrtgOperationCmdlet) { return(true); } if (!ProgressManager.IsPureThirdPartyCmdlet(commands[i].GetType())) { return(false); } } return(false); }
//whats the difference between this and PipelineIsProgressPureFromPrtgCmdlet public bool PipelineIsProgressPure() { var commands = GetPipelineCommands(); var myIndex = commands.IndexOf(cmdlet); if (myIndex <= 0) { return(true); } for (int i = 0; i < myIndex; i++) { var command = commands[i]; if (!(command is PrtgCmdlet || ProgressManager.IsPureThirdPartyCmdlet(command.GetType()))) { return(false); } } return(true); }