Example #1
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            IWindowAction action;
            string        name = ((ComboBoxItem)comboBoxActions.SelectedItem).Content as string;

            switch (name)
            {
            case "Bring to front":
                action = new WindowActionBringToFront();
                break;

            case "Close":
                action = new WindowActionClose();
                break;

            case "Maximize":
                action = new WindowActionMaximize();
                break;

            case "Minimize":
                action = new WindowActionMinimize();
                break;

            case "Move":
                action = new WindowActionMove();
                break;

            case "Restore":
                action = new WindowActionRestore();
                break;

            case "Resize":
                action = new WindowActionResize();
                break;

            case "Send keys":
                action = new WindowActionSendKeys();
                break;

            case "Wait":
                action = new WindowActionWait();
                break;

            default:
                return;
            }

            Add(action);
            CheckCanSave();
        }
Example #2
0
        public WindowSendKeys(WindowActionSendKeys action)
        {
            InitializeComponent();

            this.action = action;

            interceptKeys = InterceptKeys.Instance;

            keysDown = new List <System.Windows.Forms.Keys>();
            foreach (System.Windows.Forms.Keys key in action.KeyList)
            {
                keysDown.Add(key);
            }

            UpdateText();
        }