Ejemplo n.º 1
0
        protected virtual void OnReloggerEvent(ReloggerEventArgs reloggerEventArgs)
        {
            switch (reloggerEventArgs.Type)
            {
                case ERelogEventArgsType.OnStart:
                    Logger.LoggingObject.Log(Level.Debug, "Received OnStart event for: {0}.",
                                             reloggerEventArgs.Account.LoginName);
                    break;
                case ERelogEventArgsType.OnKill:
                    Logger.LoggingObject.Log(Level.Debug, "Received OnStop event for: {0}.",
                                             reloggerEventArgs.Account.LoginName);
                    break;
                case ERelogEventArgsType.OnSchedule:
                    Logger.LoggingObject.Log(Level.Debug, "Received Scheduler event for: {0}.",
                                             reloggerEventArgs.Account.LoginName);
                    break;
                case ERelogEventArgsType.OnError:
                    Logger.LoggingObject.Log(Level.Error, "Received an error event for: {0}.",
                                             reloggerEventArgs.Account.LoginName);
                    break;
                case ERelogEventArgsType.OnCrash:
                    Logger.LoggingObject.Log(Level.Critical, "Received a crash event for: {0}.",
                                             reloggerEventArgs.Account.LoginName);
                    break;
                case ERelogEventArgsType.OnUnknown:
                    Logger.LoggingObject.Log(Level.Debug, "Received an unidentified event for: {0}.",
                                             reloggerEventArgs.Account.LoginName);
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            ReloggerHandler handler = ReloggerEvent;
            if (handler != null) handler(this, reloggerEventArgs);
        }
Ejemplo n.º 2
0
 private void NewControlOnStartClick(object sender, ReloggerEventArgs reloggerEventArgs)
 {
     Logger.LoggingObject.Log(Level.Info, "Activating scheduler for {0}.", reloggerEventArgs.Account.LoginName);
     Scheduler wanted = Config.Singleton.SchedulerSettings.FirstOrDefault(
         a => a.Account.LoginName == reloggerEventArgs.Account.LoginName);
     if (wanted != null) wanted.SetShouldBeRunning(true);
 }
Ejemplo n.º 3
0
 private void NewControlOnScheduleClick(object sender, ReloggerEventArgs reloggerEventArgs)
 {
     Logger.LoggingObject.Log(Level.Info, "Opening shedule form for {0}.", reloggerEventArgs.Account.LoginName);
     AccountClass wanted = Config.Singleton.AccountSettings.FirstOrDefault(
         a =>
         a.PID == reloggerEventArgs.Account.PID && a.LoginName == reloggerEventArgs.Account.LoginName &&
         a.Password == reloggerEventArgs.Account.Password);
     var schedulerForm = new SchedulerForm(this, wanted, StyleManager);
     schedulerForm.ShowDialog();
 }
Ejemplo n.º 4
0
 private void NewControlOnKillClick(object sender, ReloggerEventArgs reloggerEventArgs)
 {
     Logger.LoggingObject.Log(Level.Info, "Deactivating scheduler for {0}.", reloggerEventArgs.Account.LoginName);
     AccountClass wanted = Config.Singleton.AccountSettings.FirstOrDefault(
         a => a.LoginName == reloggerEventArgs.Account.LoginName);
     if (wanted != null)
     {
         wanted.Kill();
         Config.Singleton.SchedulerSettings.First(s => s.Account.LoginName == wanted.LoginName)
               .SetShouldBeRunning(false);
     }
 }