private void UpdateBetQueue(AgentToClientBet bet1) { if (this._synchronisingObject != null) { if (this._synchronisingObject.InvokeRequired) { this._synchronisingObject.BeginInvoke(new ProcessEventBetQueueDelegate(this.UpdateBetQueue), new object[] { bet1 }); } else { IEnumerator enumerator = null; ListViewItem current = new ListViewItem(); MatchBetNew new2 = bet1.get_SourceAgentMemberBet(); try { enumerator = this.get_lstBetQueue().Items.GetEnumerator(); while (enumerator.MoveNext()) { current = (ListViewItem) enumerator.Current; if (current.SubItems[3].Text == new2.get_ID()) { current.SubItems[0x10].Text = bet1.get_Status(); if (bet1.get_Status().Contains("Stop") | bet1.get_Status().Contains("Changed")) { current.SubItems[0x10].ForeColor = Color.Red; } else { if (bet1.get_Status().Contains("OK")) { current.SubItems[0x10].ForeColor = Color.Blue; continue; } if (bet1.get_Status().Contains("Betting")) { current.SubItems[0x10].ForeColor = Color.Green; continue; } if (bet1.get_Status().Contains("Finding")) { current.SubItems[0x10].ForeColor = Color.DarkGray; continue; } if (bet1.get_Status().Contains("Found")) { current.SubItems[0x10].ForeColor = Color.LightGreen; } } } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } } }
private void AddBetQueue(AgentToClientBet bet1) { if (this._synchronisingObject != null) { if (this._synchronisingObject.InvokeRequired) { this._synchronisingObject.BeginInvoke(new ProcessEventBetQueueDelegate(this.AddBetQueue), new object[] { bet1 }); } else { MatchBetNew new2 = bet1.get_SourceAgentMemberBet(); ListViewItem item = new ListViewItem(); item.UseItemStyleForSubItems = false; item.SubItems.Add(new2.get_MemberName()); item.SubItems.Add(new2.get_Company()); item.SubItems.Add(new2.get_ID()); item.SubItems.Add(new2.get_BetCoverage().ToString()); item.SubItems.Add(new2.get_GameType().ToString()); if (new2.get_GameType() == EnumCollection.eGameType.Running) { item.SubItems.Add(Conversions.ToString(new2.get_HomeScore()) + "-" + Conversions.ToString(new2.get_AwayScore())); } else { item.SubItems.Add("-"); } item.SubItems.Add(new2.get_HomeName()); item.SubItems[item.SubItems.Count - 1].ForeColor = new2.get_HomeColor(); item.SubItems.Add(new2.get_AwayName()); item.SubItems[item.SubItems.Count - 1].ForeColor = new2.get_AwayColor(); item.SubItems.Add(new2.get_SelectedMatch()); item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Green; if (this.get_IsShowHDPDoubleStyle()) { item.SubItems.Add(new2.get_HDPDouble().ToString("N2")); } else { item.SubItems.Add(new2.get_HDP()); } item.SubItems.Add(new2.get_OddsString()); if (new2.get_Odds() >= 0.0) { item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Blue; } else { item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Red; } item.SubItems.Add(new2.get_BetAmount()); if (bet1.get_TargetAmount() > -1) { item.SubItems.Add(Conversions.ToString(bet1.get_TargetAmount())); } else { item.SubItems.Add("Max Bet"); } item.SubItems.Add(new2.get_CreateDate().ToLongTimeString()); item.SubItems.Add(new2.get_BetFollowMethod().ToString()); if (new2.get_BetFollowMethod() == EnumCollection.eBetFollowMethod.Opposite) { item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Red; } else { item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Blue; } item.SubItems.Add(bet1.get_Status()); if (bet1.get_Status().Contains("Stop")) { item.SubItems[0x10].ForeColor = Color.Red; } else if (bet1.get_Status().Contains("OK")) { item.SubItems[0x10].ForeColor = Color.Blue; } else if (bet1.get_Status().Contains("Betting")) { item.SubItems[0x10].ForeColor = Color.Green; } else if (bet1.get_Status().Contains("Finding")) { item.SubItems[0x10].ForeColor = Color.DarkGray; } else if (bet1.get_Status().Contains("Found")) { item.SubItems[0x10].ForeColor = Color.LightGreen; } if ((this.get_lstBetQueue().Items.Count % 2) == 1) { int num3 = item.SubItems.Count - 1; for (int i = 0; i <= num3; i++) { item.SubItems[i].BackColor = Color.FromArgb(240, 0xf8, 0xff); } } this.get_lstBetQueue().Items.Add(item); if (this.get_lstBetQueue().Items.Count > 0) { this.get_lstBetQueue().Items[this.get_lstBetQueue().Items.Count - 1].Selected = true; this.get_lstBetQueue().Items[this.get_lstBetQueue().Items.Count - 1].EnsureVisible(); } this.get_lblTotalCount().Text = "Total Count: " + this.get_lstBetQueue().Items.Count.ToString(); } } }