private void Bot_StateChanged(BotClient.State state) { if (state == BotClient.State.Started) { Reset(); } }
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); } }); }
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); }); }
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); }); }