示例#1
0
 private void Bot_StateChanged(BotClient.State state)
 {
     if (state == BotClient.State.Started)
     {
         Reset();
     }
 }
示例#2
0
 private void Bot_StateChanged(BotClient.State state)
 {
     Dispatcher.InvokeAsync(delegate
     {
         string stateText;
         if (state == BotClient.State.Started)
         {
             stateText = "started";
             StartScriptButtonIcon.Kind = PackIconKind.Pause;
         }
         else if (state == BotClient.State.Paused)
         {
             stateText = "paused";
             StartScriptButtonIcon.Kind = PackIconKind.Play;
         }
         else
         {
             stateText = "stopped";
             StartScriptButtonIcon.Kind = PackIconKind.Play;
         }
         if (stateText == "started")
         {
             LogMessage("Bot " + stateText, (Brush) new BrushConverter().ConvertFrom("#28d659"));
         }
         else
         {
             LogMessage("Bot " + stateText, Brushes.OrangeRed);
         }
     });
 }
示例#3
0
 private void Bot_StateChanged(BotClient.State state)
 {
     Device.BeginInvokeOnMainThread(() =>
     {
         string stateText;
         if (state == BotClient.State.Started)
         {
             stateText            = "started";
             btnBot.Text          = "Pause";
             btnStopBot.IsEnabled = true;
         }
         else if (state == BotClient.State.Paused)
         {
             stateText            = "paused";
             btnBot.Text          = "Start";
             btnStopBot.IsEnabled = true;
         }
         else
         {
             stateText            = "stopped";
             btnBot.Text          = "Start";
             btnStopBot.IsEnabled = false;
         }
         LogMessage("Bot " + stateText);
     });
 }
示例#4
0
 private void Bot_StateChanged(BotClient.State state)
 {
     Dispatcher.InvokeAsync(delegate
     {
         UpdateBotMenu();
         string stateText;
         if (BotClient.State.Started == state)
         {
             stateText = "started";
             StartScriptButtonIcon.Icon = FontAwesome.WPF.FontAwesomeIcon.Pause;
         }
         else if (BotClient.State.Paused == state)
         {
             stateText = "paused";
             StartScriptButtonIcon.Icon = FontAwesome.WPF.FontAwesomeIcon.Play;
         }
         else
         {
             stateText = "stopped";
             StartScriptButtonIcon.Icon = FontAwesome.WPF.FontAwesomeIcon.Play;
         }
         LogMessage("Bot " + stateText);
     });
 }