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 {} }
private void TestAppForm_Closing(object sender, System.ComponentModel.CancelEventArgs e) { foreach (Control control in this.MdiChildren) { if (control is StateDiagramView) { StateDiagramView view = control as StateDiagramView; if (view.StateControl.Model.IsDirty) { view.StateControl.SaveFile(); if (view.StateControl.Model.IsDirty) { string q1 = "State App: Are you sure you want to quit?"; string q2 = "The diagram " + view.StateControl.Model.Header.Name + " has been modified\nbut has not been saved."; DialogResult result = MessageBox.Show(this, q2, q1, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); e.Cancel = result == DialogResult.No; if (e.Cancel) { break; } } } } } }
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 {} }
public StateProtoViewAnimator(ILQHsm hsm, StateDiagramView view) { _Hsm = hsm; _View = view; _Hsm_StateChange_RunInViewThread_Handler = new HsmStateChangeHander(_Hsm_StateChange_RunInViewThread); RegisterEvents (); }
protected void ExecuteComponentFrame() { ProcessComponentFrame frame = new ProcessComponentFrame(_Model, _Context.AppForm()); frame.Refresh += new EventHandler(_Context.RefreshView); ProcessComponentFrameExecutionView view = new ProcessComponentFrameExecutionView(); view.Init(frame); StateDiagramView dv = _Context.ParentStateDiagramView; dv.SetExecutionWindow(view); view.Show(); foreach (DictionaryEntry de in frame.ComponentContexts) { ProcessComponentFrame.ComponentContext ctx = de.Value as ProcessComponentFrame.ComponentContext; ExecuteHsm(ctx.ComponentName, ctx.Hsm); } }
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); } } }
private void newStateChartDiagramMenuItem_Click(object sender, System.EventArgs e) { StateDiagramView view = new StateDiagramView(); AddChild(Guid.NewGuid().ToString(), "Noname", view); }
private void newStateChartDiagramMenuItem_Click(object sender, System.EventArgs e) { StateDiagramView view = new StateDiagramView (); AddChild (Guid.NewGuid ().ToString (), "Noname", view); }