public override void Startup() { FormViewModule viewMod = EditorService.Instance.QueryModule<FormViewModule>(null); // NOTE [操作模式参考] 如果操作模式需要用到视图,可以用QueryView从调度层请求过来 customView = viewMod.QueryView<ICustomView>(null); canvas = (ICanvasView)viewMod.QueryView<ICustomView>(null); stageEditCtrl = (StageEditControl)canvas; // NOTE [操作模式参考] 以下代码也是控制ICustomView呈现的例子 // customView.AddPickOneChooser2("rb3", new String[] { "图章", "自由" }, makeMode); // customView.AddCommander("在视图中心创建", delegate { createSpriteInMiddleOfView(); }); // customView.AddYesNoChooser("cb1", "半透明", isHalfAlpha); // customView.AddPickOneChooser("cbb2", new String[] { "默认名称", "名称1", "名称2", "名称3" }, 0); }
private void onTurnOn() { toolMod.SetToolContextControl(contextCtrl); stageEditCtrl = EditorService.Instance.QueryModule<FormStageModule>().EditMainControl1; stageEditCtrl.MouseMove += new System.Windows.Forms.MouseEventHandler(stageEditCtrl_MouseMove); stageEditCtrl.MouseClick += new System.Windows.Forms.MouseEventHandler(stageEditCtrl_MouseClick); stageEditCtrl.FormDrawAfter += new EventHandler<System.Windows.Forms.PaintEventArgs>(stageEditCtrl_FormDrawAfter); }
private void onTurnOff() { stageEditCtrl = EditorService.Instance.QueryModule<FormStageModule>().EditMainControl1; stageEditCtrl.MouseMove -= new System.Windows.Forms.MouseEventHandler(stageEditCtrl_MouseMove); stageEditCtrl.MouseClick -= new System.Windows.Forms.MouseEventHandler(stageEditCtrl_MouseClick); stageEditCtrl.FormDrawAfter -= new EventHandler<System.Windows.Forms.PaintEventArgs>(stageEditCtrl_FormDrawAfter); }