private void btnSingleMatch_Click(object sender, RoutedEventArgs e) { tbMatchResult.Text = "比赛中"; tbLotteryResult.Text = "等待抽卡"; UnitOnLineTest matchTest = new UnitOnLineTest(CboxZones.SelectedItem.ToString(), _nc[CboxZones.SelectedItem.ToString()], txtAccount.Text, CreateSingleCallBack); Thread thread = new Thread(() => matchTest.StartMatch()); thread.IsBackground = true; thread.Start(); }
private void Start() { _threadList = new List <Thread>(_zoneDic.Count); _unitTestEntity = new List <UnitTestEntity>(_zoneDic.Count); Dictionary <string, string> .KeyCollection keys = _zoneDic.Keys; DataGridMatchList.Items.Clear(); lblState.Content = "运行中"; foreach (var zone in keys) { UnitOnLineTest matchTest = new UnitOnLineTest(zone, _zoneDic[zone], txtAccount.Text, CreateCallBack); Thread thread = new Thread(() => matchTest.StartMatch()); thread.IsBackground = true; thread.Start(); _threadList.Add(thread); } }