Esempio n. 1
0
        public void Start()
        {
            lock (_locker)
            {
                if (_hasInited)
                {
                    _isRunning = true;
                    _team.SignIn(_center, _localMode);
                    var caseIds = _center.GetCaseIds(_team.GetId().Result).Result;
                    foreach (var cId in caseIds)
                    {
                        var workList = new List<ASWWorker>();
                        for (int i = 0; i < THREAD_PER_CASE; i++)
                        {
                            var w = new ASWWorker(cId, this);
                            w.Index = i;
                            workList.Add(w);
                            Task.Factory.StartNew(w.Start);
                        }

                        if (!_workers.ContainsKey(cId))
                        {
                            _workers.Add(cId, workList);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 public void Init()
 {
     //Guider.Start();
     //Console.WriteLine("Guider starting ...");
     //while (!Guider.IsRunning)
     //{
     //    Task.Delay(1000);
     //}
     Console.WriteLine("Guider started");
     _appCase = new ApplicationCase()
     {
         Id = "4f890d2b-7d1e-4932-8585-118254e0f375",
         Username = "******",
         Password = "******"
     };
     _worker = new ASWWorker(_appCase.Id, null);
 }