public void OpenDividends(bool edit, bool currentDiv) { List<StockInfo> lstStockInfo = new List<StockInfo>(); PleaseWait pw = new PleaseWait(); pw.Show(); Application.DoEvents(); if (_Dividends == null || _Dividends.IsDisposed) { if (edit) { if (currentDiv) { if (uti.DividendStatsValid(lstID)) { lstStockInfo = GetStockInfoList(lvCurrentDividends); } else { pw.Close(); return; } } else { if (uti.DividendStatsValid(lstID)) { lstStockInfo = GetStockInfoList(lvAllDividends); } else { pw.Close(); return; } } _Dividends = new Dividends(edit, currentDiv, lstStockInfo); } else { _Dividends = new Dividends(edit, currentDiv); } _Dividends.Show(); } else { _Dividends.Close(); if (edit) { if (currentDiv) { if (uti.DividendStatsValid(lstID)) { lstStockInfo = GetStockInfoList(lvCurrentDividends); } else { pw.Close(); return; } } else { if (uti.DividendStatsValid(lstID)) { lstStockInfo = GetStockInfoList(lvAllDividends); } else { pw.Close(); return; } } _Dividends = new Dividends(edit, currentDiv, lstStockInfo); } else { _Dividends = new Dividends(edit, currentDiv); } //if (_Dividends.WindowState == FormWindowState.Minimized) //{ // _Dividends.WindowState = FormWindowState.Normal; //} //else //{ // _Dividends.BringToFront(); //} _Dividends.Show(); } pw.Close(); }
public void OpenDividends(bool edit, string id, string symbol) { PleaseWait pw = new PleaseWait(); pw.Show(); Application.DoEvents(); if (_Dividends == null || _Dividends.IsDisposed) { _Dividends = new Dividends(edit, id, CurrentDiv, symbol); _Dividends.Show(); } else { if (_Dividends.WindowState == FormWindowState.Minimized) { _Dividends.WindowState = FormWindowState.Normal; } else { _Dividends.BringToFront(); } } pw.Close(); }