Ejemplo n.º 1
0
        public static void Init()
        {
            Form = new MainForm();
            Form.OnLaunchAllButtonClick       += delegate(object sender, EventArgs e) { OnLaunchAllButtonClick?.Invoke(sender, null); };
            Form.OnClientsButtonClick         += delegate(object sender, EventArgs e) { OnClientsButtonClick?.Invoke(sender, null); };
            Form.OnStopAllButtonClick         += delegate(object sender, EventArgs e) { OnStopAllButtonClick?.Invoke(sender, null); };
            Form.OnLaunchContextMenuItemClick += delegate(object sender, LaunchSeveralBotsArgs e) { OnLaunchContextMenuItemClick?.Invoke(sender, e); };
            Form.OnStopContextMenuItemClick   += delegate(object sender, StopSeveralBotsArgs e) { OnStopContextMenuItemClick?.Invoke(sender, e); };
            Form.Show();

            DBHelper.CheckDB();

            BotController.BotLaunched += delegate(object sender, BotLaunchedArgs e) { BotLaunched?.Invoke(sender, e); };
            BotController.BotStopped  += delegate(object sender, BotStoppedArgs e) { BotStopped?.Invoke(sender, e); };
            BotController.BotChecked  += delegate(object sender, BotCheckedArgs e) { BotChecked?.Invoke(sender, e); };
            BotController.Init();

            ClientController.Init();

            Form.Hide();
            Form.ShowDialog();
        }
Ejemplo n.º 2
0
 private void StopAllButton_Click(object sender, EventArgs e)
 {
     OnStopAllButtonClick?.Invoke(sender, null);
 }