public ExecuteCommandCheck(IActivateItems activator, ICheckable checkable) : base(activator) { _checkable = checkable; }
/// <summary> /// Adds the check. /// </summary> /// <param name="check">The check.</param> public virtual void AddCheck(ICheckable check) { this.ChecksList.Add(check); }
/// <summary> /// Removes the check. /// </summary> /// <param name="check">The check.</param> public virtual void RemoveCheck(ICheckable check) { this.ChecksList.Remove(check); }
/// <summary> /// Runs checks on all components in the pipeline that support <see cref="ICheckable"/> /// </summary> /// <param name="notifier"></param> public void Check(ICheckNotifier notifier) { try { ICheckable checkableSource = Source as ICheckable; if (checkableSource != null) { notifier.OnCheckPerformed(new CheckEventArgs("About to start checking Source component " + checkableSource, CheckResult.Success)); checkableSource.Check(notifier); } else { notifier.OnCheckPerformed( new CheckEventArgs( "Source component " + Source + " does not support ICheckable so skipping checking it", CheckResult.Warning)); } foreach (IDataFlowComponent <T> component in Components) { ICheckable checkable = component as ICheckable; if (checkable != null) { notifier.OnCheckPerformed(new CheckEventArgs("About to start checking component " + component, CheckResult.Success)); checkable.Check(notifier); } else { notifier.OnCheckPerformed( new CheckEventArgs( "Component " + component + " does not support ICheckable so skipping checking it", CheckResult.Warning)); } } ICheckable checkableDestination = Destination as ICheckable; if (checkableDestination != null) { notifier.OnCheckPerformed(new CheckEventArgs("About to start checking Destination component " + checkableDestination, CheckResult.Success)); checkableDestination.Check(notifier); } else { notifier.OnCheckPerformed( new CheckEventArgs( "Destination component " + Destination + " does not support ICheckable so skipping checking it", CheckResult.Warning)); } } catch (Exception e) { notifier.OnCheckPerformed( new CheckEventArgs( typeof(DataFlowPipelineEngine <T>).Name + " Checking failed in an unexpected way", CheckResult.Fail, e)); } notifier.OnCheckPerformed(new CheckEventArgs("Finished checking all components", CheckResult.Success)); }
public void StartChecking(ICheckable checkable) { this.Show(); checksUI1.AllChecksComplete += AllChecksComplete; checksUI1.StartChecking(checkable); }
static RingerModeSchedule GetModel(ICheckable vibrate, TextView from, TextView to, ICheckable mon, ICheckable tue, ICheckable wed, ICheckable thu, ICheckable fri, ICheckable sat, ICheckable sun) => new RingerModeSchedule { Mode = vibrate.Checked ? RingerMode.Vibrate : RingerMode.Silent, From = DateTime.Parse(from.Text).TimeOfDay, To = DateTime.Parse(to.Text).TimeOfDay, Days = GetSelectedWeekDays(mon, tue, wed, thu, fri, sat, sun) };
static WeekDay GetSelectedWeekDays(ICheckable mon, ICheckable tue, ICheckable wed, ICheckable thu, ICheckable fri, ICheckable sat, ICheckable sun) { var days = mon.Checked ? WeekDay.Monday : 0; days = days | (tue.Checked ? WeekDay.Tuesday : 0); days = days | (wed.Checked ? WeekDay.Wednesday : 0); days = days | (thu.Checked ? WeekDay.Thursday : 0); days = days | (fri.Checked ? WeekDay.Friday : 0); days = days | (sat.Checked ? WeekDay.Saturday : 0); days = days | (sun.Checked ? WeekDay.Sunday : 0); return(days); }
public virtual ICheckable[] RadioBoxs(TestProperty[] properties) { GetMapObjects(TestObjectType.RadioBox, properties); ICheckable[] tmp = new ICheckable[_lastObjects.Length]; _lastObjects.CopyTo(tmp, 0); return tmp; }
public virtual ICheckable[] RadioBoxs(string name) { GetMapObjects(TestObjectType.RadioBox, name); ICheckable[] tmp = new ICheckable[_lastObjects.Length]; _lastObjects.CopyTo(tmp, 0); return tmp; }
public int Run(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IDataLoadEventListener listener, ICheckNotifier checkNotifier, GracefulCancellationToken token) { RepositoryLocator = repositoryLocator; Token = token; List <Task> tasks = new List <Task>(); Semaphore semaphore = null; if (_options.MaxConcurrentExtractions != null) { semaphore = new Semaphore(_options.MaxConcurrentExtractions.Value, _options.MaxConcurrentExtractions.Value); } Initialize(); switch (_options.Command) { case CommandLineActivity.none: break; case CommandLineActivity.run: object[] runnables = GetRunnables(); foreach (object runnable in runnables) { if (semaphore != null) { semaphore.WaitOne(); } object r = runnable; tasks.Add(Task.Run(() => { try { ExecuteRun(r, new OverrideSenderIDataLoadEventListener(r.ToString(), listener)); } finally { if (semaphore != null) { semaphore.Release(); } } })); } break; case CommandLineActivity.check: lock (_oLock) _checksDictionary.Clear(); ICheckable[] checkables = GetCheckables(checkNotifier); foreach (ICheckable checkable in checkables) { if (semaphore != null) { semaphore.WaitOne(); } ICheckable checkable1 = checkable; var memory = new ToMemoryCheckNotifier(checkNotifier); lock (_oLock) _checksDictionary.Add(checkable1, memory); tasks.Add(Task.Run(() => { try { checkable1.Check(memory); } finally { if (semaphore != null) { semaphore.Release(); } } })); } break; default: throw new ArgumentOutOfRangeException(); } Task.WaitAll(tasks.ToArray()); AfterRun(); return(0); }
protected ScheduledDataLoadProcess(IRDMPPlatformRepositoryServiceLocator repositoryLocator, ILoadMetadata loadMetadata, ICheckable preExecutionChecker, IDataLoadExecution loadExecution, JobDateGenerationStrategyFactory jobDateGenerationStrategyFactory, ILoadProgressSelectionStrategy loadProgressSelectionStrategy, int?overrideNumberOfDaysToLoad, ILogManager logManager, IDataLoadEventListener dataLoadEventListener, HICDatabaseConfiguration configuration) : base(repositoryLocator, loadMetadata, preExecutionChecker, logManager, dataLoadEventListener, loadExecution, configuration) { JobDateGenerationStrategyFactory = jobDateGenerationStrategyFactory; LoadProgressSelectionStrategy = loadProgressSelectionStrategy; OverrideNumberOfDaysToLoad = overrideNumberOfDaysToLoad; }
internal ModelTreeViewNode(ICheckable modelParent, TreeViewIcon icon) : base(icon) { b_ModelParent = modelParent; b_Checked = b_ModelParent.Checked; }