Example #1
0
 void view_Run(object sender, EventArgs e)
 {
     proxyManager.Start();
     Context.Browser = Context.MainWindow.Switch("MainBrowser");
     if (Context.State.BreakReached)
     {
         Context.State.BreakReached = false;
         Context.CurrentWorker.Continue();
     }
     else
     {
         //回到主活动
         Context.ActionModel.ActiveActionModel = Context.ActionModel.MainActionModel;
         var work = new ActionRunnable(Context.ActionModel);
         Context.CurrentWorker = work;
         Context.State.DoRun(true);
         //if (Context.Identity == null && Context.ActionModel.Target != "System")
         //{
         //    Context.Browser.Navigate(StringHelper.Domain + "/account/ticket?returnUrl=" + Context.Browser.LocationUrl);
         //    view_StopRun(sender, e);
         //    return;
         //}
         work.Run(WaitComplete, true);
     }
 }
 /// <summary>
 /// 试图数据更新后,重新注册事件
 /// </summary>
 /// <param name="worker"></param>
 private void ModelViewChangedRegisterEvent(ActionRunnable worker)
 {
     worker.RunUpdateStatus   -= new EventHandler(runner_RunUpdateStatus);
     worker.RunUpdateStatus   += new EventHandler(runner_RunUpdateStatus);
     worker.RunStepped        -= new EventHandler(runner_RunStepped);
     worker.RunStepped        += new EventHandler(runner_RunStepped);
     worker.BreakpointReached -= new EventHandler(runner_BreakpointReached);
     worker.BreakpointReached += new EventHandler(runner_BreakpointReached);
 }
 void worker_ModelViewChanged(object sender, EventArgs e)
 {
     if (View.ProjectSelectIndex == 0)
     {
         ActionRunnable worker = Context.CurrentWorker;
         Model.ActiveActionModel = worker.ModelView.Model;
         ModelViewChangedRegisterEvent(worker);
     }
 }
Example #4
0
        /// <summary>
        /// 发布信息
        /// </summary>
        /// <param name="schemaId"></param>
        /// <param name="scriptId"></param>
        /// <param name="schemaObjectId"></param>
        private void Publish(string schemaId, string scriptId, string schemaObjectId)
        {
            browser.WBLButtonDown -= new csExWB.HTMLMouseEventHandler(webBrowser_WBLButtonDown);
            browser.WBLButtonDown += new csExWB.HTMLMouseEventHandler(webBrowser_WBLButtonDown);

            ThreadRepository rep = new ThreadRepository(schemaId, scriptId, schemaObjectId);
            var model            = new ModelSet(rep);

            var currentWorker = new ActionRunnable(model);

            currentWorker.Run(WaitComplete, true);
        }
Example #5
0
        public IResult Process(FakeHttpContext context, System.Runtime.InteropServices.Expando.IExpando expando)
        {
            string url    = string.Format(ServerApiInvoker.Domain + "tasks/GetLoginScriptByEmail?email={0}", Identity.MockUser.Email);
            string script = HttpRequestWapper.GetData(url, Identity.Ticket);

            var model = new ModelSet(new LocalScriptRepository(script));

            var currentWorker = new ActionRunnable(model);

            currentWorker.Run(null, true);

            return(new EmptyResult());
        }
Example #6
0
        /// <summary>
        /// 执行用户手动调整的脚本
        /// </summary>
        /// <param name="result"></param>
        private void WaitComplete(AsyncResult result)
        {
            browser.WBLButtonDown -= new csExWB.HTMLMouseEventHandler(webBrowser_WBLButtonDown);
            string customScript = ServerApiInvoker.Get_record_mark(Identity.UserId, scriptId);

            if (!string.IsNullOrEmpty(customScript) && customScript.Length > 10)
            {
                LocalScriptRepository rep = new LocalScriptRepository(customScript);
                var model = new ModelSet(rep);

                var currentWorker = new ActionRunnable(model);
                currentWorker.Run(null, true);
            }
        }
Example #7
0
        public void IeTest()
        {
            AppSettings.Instance.Debug = true;
            string fileName = @"D:\bitrun\上市公司财务报表\script\提取上市公司3大报表数据.bit";

            AppContext.Current.Browser = new MyIE();
            //构造脚本模型
            var model = new ModelSet(new FileActionRepository(fileName));

            var work = new ActionRunnable(AppContext.Current.ActionModel);

            AppContext.Current.CurrentWorker = work;
            work.Run(null, true);
        }
Example #8
0
        public IResult Process(FakeHttpContext context, System.Runtime.InteropServices.Expando.IExpando expando)
        {
            ScriptRepository rep = new ScriptRepository(context.PageUrl);

            rep.ReadScriptType = ScriptTypeEnum.Login;

            var model = new ModelSet(rep);

            var currentWorker = new ActionRunnable(model);

            currentWorker.Run(null, true);

            return(new EmptyResult()
            {
                Continue = false
            });
        }
        public AnimatingLineRenderableSeries()
        {
            _animator = ValueAnimator.OfFloat(StartValue, EndValue);
            _animator.SetInterpolator(new DecelerateInterpolator());
            _animator.SetDuration(Duration);
            _animator.AddUpdateListener(this);
            _animator.AddListener(this);

            _animatorRestartRunnable = new ActionRunnable(() =>
            {
                if (_animator.IsRunning)
                {
                    _animator.Cancel();
                }

                _animator.Start();
            });
        }
 void State_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "IsRunning" && Context.State.IsRunning)
     {
         ActionRunnable worker = Context.CurrentWorker;
         worker.ModelViewChanged += new EventHandler(worker_ModelViewChanged);
         ModelViewChangedRegisterEvent(worker);
     }
     else if (e.PropertyName == "IsBreakPoint")
     {
         View.SetBreakPoint();
     }
     else if (e.PropertyName == "SelectItemIndex")
     {
         View.SelectRow(Context.State.SelectItemIndex);
         if (Context.State.SelectItemIndex != -1)
         {
             //Model.ShouldInsertActions = true;
             Model.InsertPosition = Context.State.SelectItemIndex - 1;
         }
     }
 }