Пример #1
0
        protected override void OnProcess(Action.IAction action)
        {
            //LoggerManager.Debug("Clear TaskStorage.Storage");
            LoggerManager.Debug(action.AutomationActionData);

            this.ClearData();
        }
Пример #2
0
        protected override void OnProcess(Action.IAction action)
        {
            SendKeyAction sendKeyAction = action as SendKeyAction;

            if (sendKeyAction == null)
            {
                return;
            }

            LoggerManager.Debug(action.AutomationActionData);

            HtmlElement element = this.GetData(action) as HtmlElement;

            if (element == null)
            {
                LoggerManager.Error("Element Not Found");
                throw new ElementNoFoundException("Element Not Found", action);
            }

            this.Call <HtmlElement>(delegate(HtmlElement e)
            {
                e.Focus();
                SendKey(sendKeyAction);
            }, element);
        }
Пример #3
0
        protected override void OnProcess(Action.IAction action)
        {
            KeyboardAction keyboardAction = action as KeyboardAction;

            if (keyboardAction == null)
            {
                return;
            }

            LoggerManager.Debug(action.AutomationActionData);

            HtmlElement element = this.GetData(action) as HtmlElement;

            if (element == null)
            {
                LoggerManager.Error("Element Not Found");
                throw new ElementNoFoundException("Element Not Found", action);
            }

            if (keyboardAction.KeyDown)
            {
                this.Call <HtmlElement>(Down, element);
            }

            if (keyboardAction.KeyUp)
            {
                this.Call <HtmlElement>(Up, element);
            }
        }
Пример #4
0
        public override bool ChildComplete(Action.IAction action)
        {
            if (DateTime.Now < endDate)
            {
                return(false);
            }

            endDate = DateTime.MinValue;
            return(true);
        }
Пример #5
0
        protected override void OnProcess(Action.IAction action)
        {
            base.OnProcess(action);

            AttributeAction attributeAction = action as AttributeAction;

            if (attributeAction == null)
            {
                return;
            }

            LoggerManager.Debug(action.AutomationActionData);

            SetValue(attributeAction);
        }
Пример #6
0
        protected override void OnProcess(Action.IAction action)
        {
            TimerAction timerAction = action as TimerAction;

            if (timerAction == null)
            {
                return;
            }

            LoggerManager.Debug(action.AutomationActionData);

            if (endDate == DateTime.MinValue)
            {
                endDate = DateTime.Now.AddSeconds(timerAction.Seconds);
            }
        }
Пример #7
0
        protected override void OnProcess(Action.IAction action)
        {
            WaitAction waitAction = action as WaitAction;

            if (waitAction == null)
            {
                return;
            }

            LoggerManager.Debug(action.AutomationActionData);

            if (waitAction.Seconds > 0)
            {
                Sleep(waitAction.Seconds * 1000);
            }
            if (waitAction.Milliseconds > 0)
            {
                Sleep(waitAction.Milliseconds);
            }
        }
Пример #8
0
        protected override void OnProcess(Action.IAction action)
        {
            ScriptAction scriptAction = action as ScriptAction;

            if (scriptAction == null)
            {
                return;
            }

            LoggerManager.Debug(action.AutomationActionData);

            if (!string.IsNullOrEmpty(scriptAction.ScriptContent))
            {
                object[] args = new object[1];
                args[0] = scriptAction.ScriptContent;

                this.Call <WebBrowserEx>(delegate(WebBrowserEx ex)
                {
                    ex.Document.InvokeScript("eval", args);
                }, this.webBrowser);
            }
        }
Пример #9
0
        protected override void OnProcess(Action.IAction action)
        {
            LoggerManager.Debug(action.AutomationActionData);

            ClearHistoryAction clearHistoryAction = action as ClearHistoryAction;

            if (clearHistoryAction.ClearHistoryType == ClearHistoryType.Cookie)
            {
                Win32API.IE_ClearCookie();
            }
            else if (clearHistoryAction.ClearHistoryType == ClearHistoryType.History)
            {
                Win32API.IE_ClearHistory();
            }
            else if (clearHistoryAction.ClearHistoryType == ClearHistoryType.All)
            {
                Win32API.IE_ClearAll();
            }
            else if (clearHistoryAction.ClearHistoryType == ClearHistoryType.AllPlus)
            {
                Win32API.IE_ClearAllPlus();
            }
        }
Пример #10
0
 protected override void OnProcess(Action.IAction action)
 {
     LoggerManager.Debug(action.AutomationActionData);
 }
Пример #11
0
        protected override void OnProcess(Action.IAction action)
        {
            ScrollAction scrollAction = action as ScrollAction;

            if (scrollAction == null)
            {
                return;
            }

            LoggerManager.Debug(action.AutomationActionData);

            // page
            if (scrollAction.Position == Position.None)
            {
                return;
            }

            InitScroll();

            this.period = scrollAction.Period;

            if (scrollAction.Position == Position.PageBottom)
            {
                bottom = GetMaxPosition();
            }
            else if (scrollAction.Position == Position.Middle)
            {
                bottom = GetMaxPosition();
                bottom = bottom / 2;
            }
            else if (scrollAction.Position == Position.Element)
            {
                HtmlElement element = this.GetData(action) as HtmlElement;
                if (element == null)
                {
                    LoggerManager.Error("Element Not Found");
                    throw new ElementNoFoundException("Element Not Found", action);
                }
                bottom = GetY(element);

                if (bottom == 0)
                {
                    bottom = GetYoffset(element);
                }
            }

            if (scrollAction.Factor > 0)
            {
                bottom = bottom / scrollAction.Factor;
            }

            int current = GetY();

            if (bottom == current)
            {
                return;
            }
            else if (bottom > current)
            {
                positive = true;
                bottom  += scrollAction.Offset;
            }
            else
            {
                positive = false;
                bottom  -= scrollAction.Offset;
            }

            timer.Change(this.period, Timeout.Infinite);
        }