private void btnStart_Click(object sender, EventArgs e) { Console.SetOut(tw); Console.WriteLine("Beginning ..."); var type = ConfigSingleton.CreateInstance().GetAppConfig <string>("ReptileType"); reptile = IocUnity.GetService <IReptile>(type); reptile.Start(); }
private void btnInit_Click(object sender, EventArgs e) { var url = comboBox2.Text; var str = (string)comboBox1.SelectedItem; Task.Run(() => { reptile = Reptile.Instance(); Console.WriteLine("Init WorkManager"); workManager = new IbcWorkManager(); workManager.Init(); var id = Convert.ToInt32(str.Substring(4)); reptile.Init(workManager, dicServerLine[id].ServerIP, dicServerLine[id].ServerPort); reptile.Start(); subsManager = IocUnity.GetService <ISubscriptionManager>("SubscriptionManager"); matchManager = IocUnity.GetService <IMatchEntityManager>("MatchEntityManager"); if (string.IsNullOrEmpty(user) || string.IsNullOrEmpty(passWord)) { Console.WriteLine("Has no user or passWord"); return; } var loginParam = new LoginParam() { Username = user, Password = passWord, WebUrl = url, TakeMode = TakeMode.Pull }; subsManager.Subscribe(loginParam); var ibcSyncTimeParam = new NormalParam() { Stage = (int)MatchStageEnum.Live, TakeMode = TakeMode.Push, SubscribeType = "time", TimeParam = new SyncTimeParam() { id = "c1", rev = 0, condition = CommonTools.ToUnixTimeSpan(DateTime.Now) + "" } }; subsManager.Subscribe(ibcSyncTimeParam); }); }