protected void ExecuteHsm(string modelName, qf4net.ILQHsm hsm) { TestAppForm appForm = _Context.AppForm(); try { qf4net.ModelInformation modelInformation = hsm.ModelInformation; StateDiagramView sd = new StateDiagramView(false); sd.StateControl.SetStateMachine(_LastFileName, hsm); #warning Cleanup this code - this control uses knowledge of its parent - below (TestAppForm) and above (StateDiagramView) // find Top level form if (appForm != null) { appForm.AddChild(modelName, modelName, sd); appForm.RegisterHsm(hsm); } else { Form frm = new Form(); frm.Text = modelName; frm.Controls.Add(sd); sd.Dock = DockStyle.Fill; frm.Show(); } } catch {} }
protected void ExecuteHsm(string typeName) { /* * ExecutionControllerView view = new ExecutionControllerView (); * view.Controller = new ExecutionController (_Glyphs); * view.Controller.Refresh += new EventHandler(Controller_Refresh); * view.Show (); */ QHsmExecutionControllerView view = new QHsmExecutionControllerView(); view.Controller = new QHsmExecutionController(_Model); view.Controller.Refresh += new EventHandler(_Context.RefreshView); view.SetMachineName(typeName); //view.SetMachineModel (_Model, AppForm ()); #warning Cleanup this code - this control uses knowledge of its parent StateDiagramView dv = _Context.ParentStateDiagramView; dv.SetExecutionWindow(view); view.Show(); qf4net.ILQHsm hsm = view.Controller.Hsm; TestAppForm appForm = _Context.AppForm(); if (appForm != null) { appForm.RegisterHsm(hsm); } qf4net.IQSupportsSubMachines supportsSubMachines = hsm as qf4net.IQSupportsSubMachines; if (supportsSubMachines != null) { foreach (DictionaryEntry de in supportsSubMachines.SubMachines) { qf4net.ILQHsm subMachine = de.Value as qf4net.ILQHsm; ExecuteHsm(de.Key.ToString(), subMachine); } } }