private void btChangeStrategy_Click(object sender, EventArgs e) { FormStrategyLoader form = new FormStrategyLoader(); DialogResult dialogResult = form.ShowDialog(); if (dialogResult == DialogResult.OK) { IStrategyInfo strategyInfo = form.SelectedStrategy; IStrategyData strategyData = strategyInfo.CreateStrategyData(); this.chartComponent.StrategyData = strategyData; Init(strategyData); } }
private void btRefresh_Click(object sender, EventArgs e) { IStrategyAssemblyMgr mgr = StrategyCenter.Default.GetStrategyMgr(); if (this.strategyData == null) { mgr.Refresh(); return; } string assemblyId = this.strategyData.StrategyInfo.StrategyAssembly.AssemblyName; string className = this.strategyData.StrategyInfo.ClassName; mgr.Refresh(); IStrategyInfo strategyInfo = mgr.GetStrategyAssembly(assemblyId).GetStrategyInfo(className); IStrategyData strategyData = strategyInfo.CreateStrategyData(); this.chartComponent.StrategyData = strategyData; this.Init(strategyData); MessageBox.Show("策略刷新成功"); }