private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e) { if (((DockPanel)sender).ActiveContent is frmTick) { frmTick tick = (frmTick)((DockPanel)sender).ActiveContent; NotificationCenter.Instance.Post("CHANGEPRODUCT", new Notification(tick.Tick, tick.Product)); } }
private void tsTickOrder_Click(object sender, EventArgs e) { frmTick tick = Core.Instance.CreateTickForm(string.Empty); if (tick != null) { tick.Show(dockPanel1); } }
/// <summary> /// 載入視窗設定 /// </summary> private void LoadLayout() { int[] bounds = Array.ConvertAll(Utility.Load <string>("FORM", "LOCATION").Split(','), (input) => { int re = default(int); int.TryParse(input, out re); return(re); }); if (!File.Exists(m_DockLayoutFile)) { SettingForm.Show(dockPanel1, DockState.DockRight); OrderSettingForm.Show(SettingForm.Pane, SettingForm); LogForm.Show(dockPanel1, DockState.DockBottomAutoHide); frmTick tick = Core.Instance.CreateTickForm(string.Empty); if (tick != null) { tick.Show(dockPanel1); } OrderForm.Show(tick.Pane, DockAlignment.Right, 0.6); MatchForm.Show(OrderForm.Pane, DockAlignment.Bottom, 0.5); } else { dockPanel1.LoadFromXml(m_DockLayoutFile, delegate(string persistString) { if (persistString == typeof(frmSetting).ToString()) { return(SettingForm); } if (persistString == typeof(frmLog).ToString()) { return(LogForm); } if (persistString == typeof(frmOrder).ToString()) { return(OrderForm); } if (persistString == typeof(frmSummary).ToString()) { return(SummaryForm); } if (persistString == typeof(frmMatch).ToString()) { return(MatchForm); } if (persistString == typeof(frmErr).ToString()) { return(ErrForm); } if (persistString == typeof(frmCancel).ToString()) { return(CancelForm); } if (persistString == typeof(frmPosition).ToString()) { return(PositionForm); } if (persistString == typeof(frmOrderSetting).ToString()) { return(OrderSettingForm); } if (persistString == typeof(frmTick).ToString()) { return(Core.Instance.CreateTickForm(string.Empty)); } return(null); }); } if (bounds.Length == 4) { SetBounds(bounds[0], bounds[1], bounds[2], bounds[3]); } }