/// <summary> /// Default ctor /// </summary> protected CommandStationState(ICommandStation entity, RailwayState railwayState, string[] addressSpaces) : base(entity, railwayState) { Log = LogManager.GetLogger(LogNames.CommandStationPrefix + entity.Description); myWorker = new AsynchronousWorker("csworker-" + entity.Description); this.addressSpaces = addressSpaces ?? Empty <string> .Array; power = new StateProperty <bool>(this, false, null, x => PostWorkerAction(() => OnRequestedPowerChanged(x)), OnActualPowerChanged, false); myWorker.Wait += OnWorkerWait; }
/// <summary> /// Default ctor /// </summary> public PostActionAndWaitHelper(Func <T> action, AsynchronousWorker worker) { this.action = action; this.worker = worker; worker.Stop += OnWorkerStop; }