示例#1
0
        private void OpenAddActionWindow(object sender, RoutedEventArgs e)
        {
            var addActionWindow = new AddActionWindow();

            if (addActionWindow.ShowDialog().Value)
            {
                this.actions.Add(addActionWindow.Shortcut, addActionWindow.Action);
                this.RebuildActions();
            }
        }
        private void AddActionClicked(object sender, RoutedEventArgs e)
        {
            var addActionWindow = new AddActionWindow();

            if (addActionWindow.ShowDialog().Value&& addActionWindow.DialogResult.Value)
            {
                if (!this.actions.ContainsKey(addActionWindow.Shortcut))
                {
                    this.actions.Add(addActionWindow.Shortcut, addActionWindow.Action);
                    this.Changes = true;
                }
                else
                {
                    MessageBox.Show("You can't have actions with the same shorcuts",
                                    "Warning");
                }
            }
        }