public static profitEstimate GetForm(string formName) { string cacheKey = typeof(profitEstimate).FullName + (formName == null || formName.Trim() == "" ? "" : "-" + formName); profitEstimate form = (profitEstimate)common.Data.dataCache.Find(cacheKey); if (form != null && !form.IsDisposed) return form; form = new profitEstimate(); common.Data.dataCache.Add(cacheKey, form); return form; }
public static profitEstimate GetForm(string formName) { string cacheKey = typeof(profitEstimate).FullName + (formName == null || formName.Trim() == "" ? "" : "-" + formName); profitEstimate form = (profitEstimate)common.Data.dataCache.Find(cacheKey); if (form != null && !form.IsDisposed) { return(form); } form = new profitEstimate(); common.Data.dataCache.Add(cacheKey, form); return(form); }
protected void ShowTradeTransactions(databases.tmpDS.stockCodeRow stockCodeRow, string strategyCode, DataParams dataParam) { string formName = stockCodeRow.code.Trim() + "," + dataParam.TimeRange.ToString() + "," + application.Strategy.StrategyLibs.GetMetaName(strategyCode) + "," + dataParam.TimeScale; profitEstimate myForm = profitEstimate.GetForm(formName); myForm.myDataParam = dataParam; myForm.myStockCode = stockCodeRow.code; myForm.myStrategyCode = strategyCode; myForm.myOptions = new EstimateOptions(); myForm.ReLoad(); myForm.Text = "(" + formName + ")"; if (this.myDockedPane != null) { myForm.Show(this.myDockedPane); } else { myForm.ShowDialog(); } }