private void CommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
            InteractiveCommand    command = commandButtonsControl.GetCommandFromCommandButtons <InteractiveCommand>(sender);

            if (command != null)
            {
                CommandWindow window = null;
                if (command is InteractiveButtonCommand)
                {
                    window = new CommandWindow(new InteractiveButtonCommandDetailsControl(this.selectedGame, this.selectedGameVersion, (InteractiveButtonCommand)command));
                }
                else if (command is InteractiveJoystickCommand)
                {
                    window = new CommandWindow(new InteractiveJoystickCommandDetailsControl(this.selectedGame, this.selectedGameVersion, (InteractiveJoystickCommand)command));
                }
                else if (command is InteractiveTextBoxCommand)
                {
                    window = new CommandWindow(new InteractiveTextBoxCommandDetailsControl(this.selectedGame, this.selectedGameVersion, (InteractiveTextBoxCommand)command));
                }

                if (window != null)
                {
                    window.Closed += Window_Closed;
                    window.Show();
                }
            }
        }
Beispiel #2
0
        private void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
            CustomCommand         command = commandButtonsControl.GetCommandFromCommandButtons <CustomCommand>(sender);

            if (command != null)
            {
                this.viewModel.TimerCompleteCommand = null;
            }
        }
 private void GiveawayCommand_EditClicked(object sender, RoutedEventArgs e)
 {
     CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
     CustomCommand command = commandButtonsControl.GetCommandFromCommandButtons<CustomCommand>(sender);
     if (command != null)
     {
         CommandWindow window = new CommandWindow(new CustomCommandDetailsControl(command));
         window.Show();
     }
 }
Beispiel #4
0
        private void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
            CustomCommand         command = commandButtonsControl.GetCommandFromCommandButtons <CustomCommand>(sender);

            if (command != null)
            {
                this.command = null;
                this.UpdateChangedCommand();
            }
        }
        private void CommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
            ActionGroupCommand    command = commandButtonsControl.GetCommandFromCommandButtons <ActionGroupCommand>(sender);

            if (command != null)
            {
                CommandWindow window = new CommandWindow(new ActionGroupCommandDetailsControl(command));
                window.Closed += Window_Closed;
                window.Show();
            }
        }
        private void ExistingEntranceCommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
            CustomCommand         command = commandButtonsControl.GetCommandFromCommandButtons <CustomCommand>(sender);

            if (command != null)
            {
                CommandWindow window = new CommandWindow(new CustomCommandDetailsControl(command));
                window.Closed += Window_Closed;
                window.Show();
            }
        }
        private void UserOnlyChatCommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
            ChatCommand           command = commandButtonsControl.GetCommandFromCommandButtons <ChatCommand>(sender);

            if (command != null)
            {
                CommandWindow window = new CommandWindow(new ChatCommandDetailsControl(command, autoAddToChatCommands: false));
                window.Closed += Window_Closed;
                window.Show();
            }
        }
        private void CommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl commandButtonControl = (CommandButtonsControl)sender;
            GameCommandBase       command = commandButtonControl.GetCommandFromCommandButtons <GameCommandBase>(sender);

            if (command != null)
            {
                GameCommandWindow window = new GameCommandWindow(command);
                window.Closed += Window_Closed;
                window.Show();
            }
        }
        private void CommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl      commandButtonsControl = (CommandButtonsControl)sender;
            TwitchChannelPointsCommand command = commandButtonsControl.GetCommandFromCommandButtons <TwitchChannelPointsCommand>(sender);

            if (command != null)
            {
                CommandWindow window = new CommandWindow(new TwitchChannelPointsCommandDetailsControl(command));
                window.CommandSaveSuccessfully += Window_CommandSaveSuccessfully;
                window.Show();
            }
        }
 private async void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
 {
     await this.RunAsyncOperation(async() =>
     {
         CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
         CustomCommand command = commandButtonsControl.GetCommandFromCommandButtons <CustomCommand>(sender);
         if (command != null)
         {
             this.viewModel.RankChangedCommand = null;
             await ChannelSession.SaveSettings();
         }
     });
 }
 private async void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
 {
     await this.Window.RunAsyncOperation(async() =>
     {
         CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
         ActionGroupCommand command = commandButtonsControl.GetCommandFromCommandButtons <ActionGroupCommand>(sender);
         if (command != null)
         {
             ChannelSession.Settings.ActionGroupCommands.Remove(command);
             await ChannelSession.SaveSettings();
             this.RefreshList();
         }
     });
 }
 private async void ExistingEntranceCommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
 {
     await this.RunAsyncOperation(async() =>
     {
         CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
         CustomCommand command = commandButtonsControl.GetCommandFromCommandButtons <CustomCommand>(sender);
         if (command != null)
         {
             this.user.Data.EntranceCommand = null;
             await ChannelSession.SaveSettings();
             await this.RefreshData();
         }
     });
 }
 private async void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
 {
     await this.Window.RunAsyncOperation(async() =>
     {
         CommandButtonsControl commandButtonControl = (CommandButtonsControl)sender;
         GameCommandBase command = commandButtonControl.GetCommandFromCommandButtons <GameCommandBase>(sender);
         if (command != null)
         {
             ChannelSession.Settings.GameCommands.Remove(command);
             await ChannelSession.SaveSettings();
             this.viewModel.Refresh();
         }
     });
 }
Beispiel #14
0
        private void DataGridRow_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            DataGridRow           row = sender as DataGridRow;
            CommandButtonsControl commandButtonsControl = VisualTreeHelpers.GetVisualChild <CommandButtonsControl>(row);

            if (commandButtonsControl != null)
            {
                RemoteCommand command = commandButtonsControl.GetCommandFromCommandButtons <RemoteCommand>();
                if (command != null)
                {
                    this.CurrentlySelectedCommand = command;
                }
            }
        }
Beispiel #15
0
        private async void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
        {
            await this.Window.RunAsyncOperation(async() =>
            {
                CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
                ChatCommand command = commandButtonsControl.GetCommandFromCommandButtons <ChatCommand>(sender);
                if (command != null)
                {
                    ChannelSession.Settings.ChatCommands.Remove(command);
                    await ChannelSession.SaveSettings();
                    this.viewModel.RemoveCommand(command);

                    ChannelSession.Services.Chat.RebuildCommandTriggers();
                }
            });
        }
        private async void CommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl commandButtonsControl = (CommandButtonsControl)sender;
            InteractiveCommand    command = commandButtonsControl.GetCommandFromCommandButtons <InteractiveCommand>(sender);

            if (command != null)
            {
                if (!this.ValidateCommandMatchesControl(command))
                {
                    string oldControlType = string.Empty;
                    if (command is InteractiveButtonCommand)
                    {
                        oldControlType = "Button";
                    }
                    if (command is InteractiveJoystickCommand)
                    {
                        oldControlType = "Joystick";
                    }
                    if (command is InteractiveTextBoxCommand)
                    {
                        oldControlType = "Text Box";
                    }

                    string newControlType = string.Empty;
                    if (command.Control is InteractiveButtonControlModel)
                    {
                        newControlType = "Button";
                    }
                    if (command.Control is InteractiveJoystickControlModel)
                    {
                        newControlType = "Joystick";
                    }
                    if (command.Control is InteractiveTextBoxControlModel)
                    {
                        newControlType = "Text Box";
                    }

                    await this.Window.RunAsyncOperation(async() =>
                    {
                        await MessageBoxHelper.ShowMessageDialog(string.Format("The control you are trying to edit has been changed from a {0} to a {1} and can not be edited. You must either change this control back to its previous type, change the control ID to something different, or delete the command to start fresh.", oldControlType, newControlType));
                    });

                    return;
                }

                CommandWindow window = null;
                if (command is InteractiveButtonCommand)
                {
                    window = new CommandWindow(new InteractiveButtonCommandDetailsControl(this.selectedGame, this.selectedGameVersion, (InteractiveButtonCommand)command));
                }
                else if (command is InteractiveJoystickCommand)
                {
                    window = new CommandWindow(new InteractiveJoystickCommandDetailsControl(this.selectedGame, this.selectedGameVersion, (InteractiveJoystickCommand)command));
                }
                else if (command is InteractiveTextBoxCommand)
                {
                    window = new CommandWindow(new InteractiveTextBoxCommandDetailsControl(this.selectedGame, this.selectedGameVersion, (InteractiveTextBoxCommand)command));
                }

                if (window != null)
                {
                    window.Closed += Window_Closed;
                    window.Show();
                }
            }
        }