static SC_ACTION GetScAction(ServiceRecoveryAction action, uint restartServiceAfter) { var scAction = new SC_ACTION(); SC_ACTION_TYPE actionType = default(SC_ACTION_TYPE); switch (action) { case ServiceRecoveryAction.TakeNoAction: actionType = SC_ACTION_TYPE.None; break; case ServiceRecoveryAction.RestartService: actionType = SC_ACTION_TYPE.RestartService; break; case ServiceRecoveryAction.RestartComputer: actionType = SC_ACTION_TYPE.RebootComputer; break; case ServiceRecoveryAction.RunProgram: actionType = SC_ACTION_TYPE.RunCommand; break; } scAction.Type = actionType; scAction.Delay = restartServiceAfter; return(scAction); }
public SC_ACTION(SC_ACTION_TYPE type, TimeSpan delay) { this.Type = type; this.Delay = (uint)delay.TotalMilliseconds; }
public SC_ACTION(SC_ACTION_TYPE type, TimeSpan delay) { Type = type; Delay = (uint)delay.TotalMilliseconds; }
public SC_ACTION(SC_ACTION_TYPE type, TimeSpan delay) { this.Type = type; this.Delay = (int)delay.TotalMilliseconds; }
public SC_ACTION(SC_ACTION_TYPE action, int delayMillisec) { this.Type = action; this.Delay = (UInt32)delayMillisec; }
public SC_ACTION(SC_ACTION_TYPE type, uint delay) : this() { this.Type = type; this.Delay = delay; }