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();
                }
            }
        }
        private void CustomProductCommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl           button  = (CommandButtonsControl)sender;
            RedemptionStoreProductViewModel product = (RedemptionStoreProductViewModel)button.DataContext;

            product.Command = null;
        }
        private void LevelCommandButtons_DeleteClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandButtonsControl button = (CommandButtonsControl)sender;
            StreamPassCustomLevelUpCommandViewModel command = (StreamPassCustomLevelUpCommandViewModel)button.DataContext;

            this.viewModel.DeleteCustomLevelUpCommand(command);
        }
        private void LevelCommandButtons_EditClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandButtonsControl button = (CommandButtonsControl)sender;
            StreamPassCustomLevelUpCommandViewModel command = (StreamPassCustomLevelUpCommandViewModel)button.DataContext;
            CommandWindow window = new CommandWindow(new CustomCommandDetailsControl(command.Command));

            window.Show();
        }
        private void CustomProductCommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandButtonsControl           button  = (CommandButtonsControl)sender;
            RedemptionStoreProductViewModel product = (RedemptionStoreProductViewModel)button.DataContext;
            CommandWindow window = new CommandWindow(new CustomCommandDetailsControl(product.Command));

            window.Show();
        }
 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();
     }
 }
Пример #7
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;
            }
        }
Пример #8
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 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();
            }
        }
Пример #11
0
        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 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 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 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();
         }
     });
 }
Пример #16
0
 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();
         }
     });
 }
 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();
         }
     });
 }
Пример #18
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;
                }
            }
        }
Пример #19
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();
                }
            }
        }