private string InnerRunRelayAction(IBasicAction portAction, string description) { IBasicNotificationList notifyOnComplete = portAction.NotifyOnComplete; try { notifyOnComplete.AddItem(threadWakeupNotifier); string resultCode = Fcns.MapNullOrEmptyTo(portAction.Start(), null); while (resultCode == null) { WaitForSomethingToDo(); InnerServiceFCServerAndStateRelay(); if (portAction.ActionState.IsComplete) { break; } } resultCode = (portAction.ActionState.ResultCode ?? Fcns.CheckedFormat("Internal: port.{0} complete with null ResultCode", description)); return(resultCode); } finally { notifyOnComplete.RemoveItem(threadWakeupNotifier); } }
//---------------------------------------- #region SimpleActivePart overridden methods /// <summary> /// Implemenation for for required GoOnline Action: runs the corresponding command on the related IPort instance and returns its result /// </summary> protected override string PerformGoOnlineAction(bool andInitialize) { IBasicAction iba = (IBasicAction)port.CreateGoOnlineAction(andInitialize); string rc = iba.Run(); PerformMainLoopService(); return(rc); }
/// <summary> /// Implemenation for for required GoOffline Action: runs the corresponding command on the related IPort instance and returns its result /// </summary> protected override string PerformGoOfflineAction() { IBasicAction iba = (IBasicAction)port.CreateGoOfflineAction(); string rc = iba.Run(); PerformMainLoopService(); return(rc); }
private string InnerRunRelayAction(IBasicAction portAction, string description) { IBasicNotificationList notifyOnComplete = portAction.NotifyOnComplete; try { notifyOnComplete.AddItem(threadWakeupNotifier); string resultCode = Fcns.MapNullOrEmptyTo(portAction.Start(), null); while (resultCode == null) { WaitForSomethingToDo(); InnerServiceFCServerAndStateRelay(); if (portAction.ActionState.IsComplete) break; } resultCode = (portAction.ActionState.ResultCode ?? Fcns.CheckedFormat("Internal: port.{0} complete with null ResultCode", description)); return resultCode; } finally { notifyOnComplete.RemoveItem(threadWakeupNotifier); } }