using System; using System.Windows.Forms; using Mesnac.Action.Base; namespace Mesnac.Action.ChemicalWeighing.LjMixFormula { public class AddAction:ChemicalWeighingAction, IAction { public static event EventHandler OnAdd; private RuntimeParameter _runtime; public void Run(RuntimeParameter runtime) { base.RunIni(runtime); //必须调用 this._runtime = runtime; FrmMixFormula frm = new FrmMixFormula(); DialogResult result = frm.ShowDialog(); this._runtime.BaseControl.MCEnabled = false; if (result == DialogResult.OK) { if (OnAdd != null) { OnAdd(this._runtime.BaseControl.MCRoot, System.EventArgs.Empty); } frm.Dispose(); } this._runtime.BaseControl.MCEnabled = true; } } }