コード例 #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
ファイル: TimerTask.cs プロジェクト: flashpoint493/xSimulate
        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
ファイル: TimerTask.cs プロジェクト: flashpoint493/xSimulate
        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
ファイル: ScriptTask.cs プロジェクト: flashpoint493/xSimulate
        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);
        }