private static void ExecuteProgram(ActionAfterPolicyCheck action) { if (action.ProgramStart != null) { ProgramManager.StartPrograms(new[] { action.ProgramStart }); } }
private static void ExecuteAction(ActionAfterPolicyCheck action) { if (action == null) { return; } WsapmLog.Log.WriteLine(string.Format(Resources.Wsapm_Core.ActionAfterPolicyCheckManager_ExecutingAction, action.ToString()), LogMode.Normal); switch (action.ActionTypeAfterPolicyCheck) { case ActionTypeAfterPolicyCheck.Standby: ShutdownManager.SetStandbyState(); break; case ActionTypeAfterPolicyCheck.Hibernate: ShutdownManager.SetHibernateState(); break; case ActionTypeAfterPolicyCheck.Shutdown: ShutdownManager.ShutDown(); break; case ActionTypeAfterPolicyCheck.StartProgram: ExecuteProgram(action); break; default: break; } }
public bool Equals(ActionAfterPolicyCheck other) { if (other == null) { return(false); } return(this.GetHashCode() == other.GetHashCode()); }
public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } ActionAfterPolicyCheck other = obj as ActionAfterPolicyCheck; return(this.Equals(other)); }
/// <summary> /// Copies the object. /// </summary> /// <returns></returns> public ActionAfterPolicyCheck Copy() { ActionAfterPolicyCheck action = new ActionAfterPolicyCheck(); action.ActionModeAfterPolicyCheck = this.ActionModeAfterPolicyCheck; action.ActionTypeAfterPolicyCheck = this.ActionTypeAfterPolicyCheck; if (this.ProgramStart != null) { action.ProgramStart = this.ProgramStart.Copy(); } return(action); }