Esempio n. 1
0
        protected override void InternalExecute(ICommandAdapter adapter)
        {
            var focusWindowCommand = new FocusWindowCommand();

            focusWindowCommand.Execute(adapter);
            var sleepCommand = new SleepCommand();

            sleepCommand.Parameters.MainParameter = new MainParameter("300");
            sleepCommand.Execute(adapter);
            var simulator = new InputSimulator();

            if (!string.IsNullOrEmpty(Parameters.MainParameter.Value))
            {
                simulator.Keyboard.TextEntry(Parameters.MainParameter.Value);
            }
            var keysParameter = Parameters["Keys"];

            if (keysParameter != null)
            {
                foreach (var key in keysParameter.Value.Split(';'))
                {
                    var keyCode = (VirtualKeyCode)Enum.Parse(typeof(VirtualKeyCode), key);
                    simulator.Keyboard.KeyPress(keyCode);
                }
            }
        }
        private static void Wait(ICommandAdapter adapter, int interval)
        {
            var sleepCommand = new SleepCommand();

            sleepCommand.Parameters.MainParameter = new MainParameter(interval.ToString(CultureInfo.InvariantCulture));
            sleepCommand.Execute(adapter);
        }
Esempio n. 3
0
        public void TestSimple()
        {
            SleepCommand sc    = new SleepCommand(TimeSpan.FromMilliseconds(10000));
            var          start = DateTime.Now;

            sc.Execute();
            TimeSpan span = DateTime.Now - start;

            Assert.That((int)span.TotalMilliseconds, Is.GreaterThanOrEqualTo(10000));
        }
Esempio n. 4
0
        protected override void InternalExecute(ICommandAdapter adapter)
        {
            var actionCommand = new ActionCommand();

            actionCommand.Parameters.MainParameter  = new MainParameter("Log Off");
            actionCommand.Parameters.ExtraParameter = new MainParameter();
            actionCommand.Execute(adapter);
            var sleepCommand = new SleepCommand();

            sleepCommand.Parameters.MainParameter = new MainParameter("2000");
            sleepCommand.Execute(adapter);
        }
Esempio n. 5
0
 protected override void InternalExecute(ICommandAdapter adapter){
     var focusWindowCommand=new FocusWindowCommand();
     focusWindowCommand.Execute(adapter);
     var sleepCommand = new SleepCommand();
     sleepCommand.Parameters.MainParameter = new MainParameter("300");
     sleepCommand.Execute(adapter);
     var simulator=new InputSimulator();
     if (!string.IsNullOrEmpty(Parameters.MainParameter.Value))
         simulator.Keyboard.TextEntry(Parameters.MainParameter.Value);
     var keysParameter = Parameters["Keys"];
     if (keysParameter != null){
         foreach (var key in keysParameter.Value.Split(';')){
             var keyCode = (VirtualKeyCode) Enum.Parse(typeof (VirtualKeyCode), key);
             simulator.Keyboard.KeyPress(keyCode);
         }
     }
 }
Esempio n. 6
0
        protected override void InternalExecute(ICommandAdapter adapter)
        {
            base.InternalExecute(adapter);
            var sleepCommand = new SleepCommand();

            sleepCommand.Parameters.MainParameter = new MainParameter("1000");
            sleepCommand.Execute(adapter);

            var actionCommand = new ActionCommand();

            actionCommand.Parameters.MainParameter  = new MainParameter("Delete");
            actionCommand.Parameters.ExtraParameter = new MainParameter();
            actionCommand.Execute(adapter);

            var handleDialogCommand = new XpandHandleDialogCommand();

            handleDialogCommand.Parameters.Add(new Parameter("Respond", "Yes", true, EndPosition));
            handleDialogCommand.Execute(adapter);
        }
Esempio n. 7
0
        protected override void InternalExecute(ICommandAdapter adapter)
        {
            var deleteFileCommand = new XpandDeleteFileCommand();

            deleteFileCommand.Parameters.MainParameter = Parameters.MainParameter;
            deleteFileCommand.Parameters.Add(new Parameter(XpandDeleteFileCommand.InBin, "True", true, EndPosition));
            deleteFileCommand.Execute(adapter);
            var binPath         = this.GetBinPath();
            var fillFormCommand = new XpandFillFormCommand();

            fillFormCommand.Parameters.Add(new Parameter("File name:", Path.Combine(binPath, Parameters.MainParameter.Value), true, EndPosition));
            fillFormCommand.Execute(adapter);
            var handleDialogCommand = new XpandHandleDialogCommand();

            handleDialogCommand.Parameters.Add(new Parameter("Respond", ButtonLocalizations.GetLocalizedButtonCaption("Save"), true, EndPosition));
            handleDialogCommand.Execute(adapter);
            var sleepCommand = new SleepCommand();

            sleepCommand.Parameters.MainParameter = new MainParameter("1000");
            sleepCommand.Execute(adapter);
        }
 private static void Wait(ICommandAdapter adapter, int interval) {
     var sleepCommand = new SleepCommand();
     sleepCommand.Parameters.MainParameter = new MainParameter(interval.ToString(CultureInfo.InvariantCulture));
     sleepCommand.Execute(adapter);
 }