public static MartinGailManager GetInstance() { if (martinInstance == null) { martinInstance = new MartinGailManager(); } return(martinInstance); }
void UpdateUI() { if (martin_curStep_txt.InvokeRequired) { martin_curStep_txt.Invoke(new MethodInvoker(delegate() { martin_curStep_txt.Text = MartinGailManager.GetInstance().StepInner.ToString(); martin_max_try_txt.Text = MartinGailManager.GetInstance().MARTIN_MAX_STEP.ToString(); martin_win_txt.Text = MartinGailManager.GetInstance().WinCnt.ToString(); martin_lose_txt.Text = MartinGailManager.GetInstance().LoseCnt.ToString(); martin_profit.Text = MartinGailManager.GetInstance().ProfitMoney.ToString(); M_resultListBox.Items.Clear(); int index = 0; while (index < MartinGailManager.GetInstance().TodayAllList().Count) { int todayIndex = MartinGailManager.GetInstance().TodayAllList()[index].TodayIndex; int curStep = MartinGailManager.GetInstance().TodayAllList()[index].step; MARTIN_RESULT result = MartinGailManager.GetInstance().TodayAllList()[index].martinState; M_resultListBox.Items.Add(string.Format(" {0} | {1} | {2} ", todayIndex, curStep, result.ToString())); index++; } })); } else { martin_curStep_txt.Text = MartinGailManager.GetInstance().StepInner.ToString(); martin_max_try_txt.Text = MartinGailManager.GetInstance().MARTIN_MAX_STEP.ToString(); martin_win_txt.Text = MartinGailManager.GetInstance().WinCnt.ToString(); martin_lose_txt.Text = MartinGailManager.GetInstance().LoseCnt.ToString(); martin_profit.Text = MartinGailManager.GetInstance().ProfitMoney.ToString(); M_resultListBox.Items.Clear(); int index = 0; while (curMartinIndex < MartinGailManager.GetInstance().TodayAllList().Count) { int todayIndex = MartinGailManager.GetInstance().TodayAllList()[index].TodayIndex; int curStep = MartinGailManager.GetInstance().TodayAllList()[index].step; MARTIN_RESULT result = MartinGailManager.GetInstance().TodayAllList()[index].martinState; M_resultListBox.Items.Add(string.Format(" {0} | {1} | {2} ", todayIndex, curStep, result.ToString())); index++; } } }