Exemplo n.º 1
0
        private void CommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            TimerCommandModel command = ((CommandListingButtonsControl)sender).GetCommandFromCommandButtons <TimerCommandModel>();

            if (command != null)
            {
                CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(command);
                window.CommandSaved += TimerWindow_CommandSaved;
                window.ForceShow();
            }
        }
Exemplo n.º 2
0
        private async void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
        {
            await this.Window.RunAsyncOperation(async() =>
            {
                TimerCommandModel command = ((CommandListingButtonsControl)sender).GetCommandFromCommandButtons <TimerCommandModel>();
                if (command != null)
                {
                    ChannelSession.TimerCommands.Remove(command);
                    ChannelSession.Settings.RemoveCommand(command);
                    this.viewModel.RemoveCommand(command);
                    await ChannelSession.SaveSettings();

                    await ChannelSession.Services.Timers.RebuildTimerGroups();
                }
            });
        }
Exemplo n.º 3
0
 public TimerCommandEditorWindowViewModel(TimerCommandModel existingCommand) : base(existingCommand)
 {
     this.SelectedCommandGroupChanged();
 }