Exemplo n.º 1
0
        protected override void InternalExecute(ICommandAdapter adapter)
        {
            if (Parameters.MainParameter == null)
            {
                Parameters.MainParameter = new MainParameter();
            }
            var activateApplicationWindowCommand = new ActivateWindowCommand();

            activateApplicationWindowCommand.SynchWith(this);
            activateApplicationWindowCommand.Execute(adapter);


            var simulator = new Automation.InputSimulator.InputSimulator();

            if (!string.IsNullOrEmpty(Parameters.MainParameter.Value))
            {
                simulator.Keyboard.TextEntry(Parameters.MainParameter.Value);
            }
            var field = this.ParameterValue("Field", "");

            if (!string.IsNullOrEmpty(field))
            {
                var fillFieldCommand = new FillFieldCommand();
                fillFieldCommand.Parameters.Add(new Parameter(field, "", true, EndPosition));
                fillFieldCommand.Execute(adapter);
            }

            Execute(simulator);
        }
Exemplo n.º 2
0
        private void Execute(Automation.InputSimulator.InputSimulator simulator)
        {
            var keysParameter = Parameters["Keys"];
            var modifiers     = Parameters["Modifiers"];

            if (modifiers != null)
            {
                simulator.Keyboard.ModifiedKeyStroke((modifiers.Value).Split(';').Select(GetVirtualKey),
                                                     keysParameter.Value.Split(';').Select(GetVirtualKey));
            }
            else if (keysParameter != null)
            {
                foreach (var key in keysParameter.Value.Split(';'))
                {
                    var keyCode = GetVirtualKey(key);
                    simulator.Keyboard.KeyPress(keyCode);
                    simulator.Keyboard.KeyUp(keyCode);
                    Thread.Sleep(300);
                }
            }
        }
Exemplo n.º 3
0
        protected override void InternalExecute(ICommandAdapter adapter)
        {
            var inputSimulator = new Automation.InputSimulator.InputSimulator();

            inputSimulator.Mouse.DragAndDrop(this.ParameterValue <Point>("Start"), this.ParameterValue <Point>("End"));
        }