Esempio n. 1
0
        private void RegisterCommand()
        {
            var commandAPI        = UIAssistantAPI.CommandAPI;
            var argSwitch         = commandAPI.CreateArgmentRule(Consts.Switch, x => OperationManager.Change(x.Name));
            var argClick          = commandAPI.CreateArgmentRule(Consts.Click, x => OperationManager.Change(x.Name));
            var argDoubleClick    = commandAPI.CreateArgmentRule(Consts.DoubleClick, x => OperationManager.Change(x.Name));
            var argDragAndDrop    = commandAPI.CreateArgmentRule(Consts.DragAndDrop, x => OperationManager.Change(x.Name));
            var argHover          = commandAPI.CreateArgmentRule(Consts.Hover, x => OperationManager.Change(x.Name));
            var argMiddleClick    = commandAPI.CreateArgmentRule(Consts.MiddleClick, x => OperationManager.Change(x.Name));
            var argMouseEmulation = commandAPI.CreateArgmentRule(Consts.MouseEmulation, x => OperationManager.Change(x.Name));
            var argRightClick     = commandAPI.CreateArgmentRule(Consts.RightClick, x => OperationManager.Change(x.Name));

            var argRunningApps     = commandAPI.CreateArgmentRule(Consts.RunningApps, x => _stateController.ChangeTarget(EnumerateTarget.RunningApps), new[] { argSwitch });
            var argWidgetsInWindow = commandAPI.CreateArgmentRule(Consts.WidgetsInWindow, x => _stateController.ChangeTarget(EnumerateTarget.WidgetsInWindow),
                                                                  new[] { argClick, argDoubleClick, argDragAndDrop, argHover, argMiddleClick, argMouseEmulation, argRightClick });
            var argWidgetsInTaskbar = commandAPI.CreateArgmentRule(Consts.WidgetsInTaskbar, x => _stateController.ChangeTarget(EnumerateTarget.WidgetsInTaskbar),
                                                                   new[] { argClick, argDoubleClick, argDragAndDrop, argHover, argMiddleClick, argMouseEmulation, argRightClick });
            var argDividedscreen = commandAPI.CreateArgmentRule(Consts.DividedScreen, x => _stateController.ChangeTarget(EnumerateTarget.DividedScreen),
                                                                new[] { argClick, argDoubleClick, argDragAndDrop, argHover, argMiddleClick, argMouseEmulation, argRightClick });

            var optTheme          = commandAPI.CreateArgmentRule(Consts.Theme, x => _stateController.SetTemporaryTheme(x.Value));
            var optNoReturnCursor = commandAPI.CreateArgmentRule(Consts.NoReturnCursor, _ => _stateController.NoReturnCursor = true);

            var command = commandAPI.CreateCommandRule(Consts.Command, Run,
                                                       new[] { argWidgetsInWindow, argRunningApps, argWidgetsInTaskbar, argDividedscreen, },
                                                       new[] { optTheme, optNoReturnCursor });

            command.Description = Consts.PluginName;
            commandAPI.RegisterCommand(command);
        }
Esempio n. 2
0
        internal void Restore()
        {
            if (!History.CanUndo)
            {
                return;
            }
            var item = History.PopState();

            if (_api.WindowAPI.ActiveWindow != item.window)
            {
                item.window.Activate();
            }
            OperationManager.Change(item.OperationName);
            Target     = item.Target;
            Enumerator = item.Enumerator;
        }
Esempio n. 3
0
 public void ChangeToAnother(int dato)
 {
     operation.Change(dato);
 }
Esempio n. 4
0
 public void ChangeOperation(string operationName)
 {
     OperationManager.Change(operationName);
 }