public void NewDashboard() { string dname = InputBox.Run("s_type_new_dashboard_name", "new dashboard"); if (dname == null) { return; } string fn = Path.Combine(Core.DashboardsDirectory, dname + ".das"); if (File.Exists(fn)) { if (!StdDialog.ReallyOverwriteFile(fn)) { return; } } var dash = new DockPanelDashboard(fn); dash.Filter = GetFilter(); dash.SaveToFile(fn); //dash.EnableDesign(true); DashboardManager.Instance.Addons.Add(dash); var pars = new DashboardInstanceParams { LayoutName = null }; var win = dash.CreateControl(pars) as DashboardFrame; win.SetSelectedObject(this); MainWindow.Instance.OpenContent(win); MainWindow.Instance.ShowDocker(new PropertiesDockerFactory()); MainWindow.Instance.ShowDocker(new ToolboxDockerFactory()); dash.SetDesignFrame(win); }
public override Control CreateControl(DashboardInstanceParams pars) { var frame = new DashboardFrame(this, pars); frame.LoadLayoutOrOverride(m_design); //frame.EnableDesign(m_enableDesign); return(frame); }
public DashboardFrame(DockPanelDashboard dashboard, DashboardInstanceParams pars) { InitializeComponent(); ConnPack.Cache = CachePack.TreeCache; m_dashboard = dashboard; HDesigner.UseToolBoxItem += HToolbox_UseToolBoxItem; HDesigner.ChangedWidget += HDesigner_ChangedWidget; if (pars.LayoutName != null) { m_privateLayoutFile = Path.Combine(m_dashboard.PrivateLayoutDirectory, pars.LayoutName + ".dly"); } Disposed += DashboardFrame_Disposed; btnDesign.Visible = btnSettings.Visible = CustomDashboardsFeature.Allowed; }
public void OpenAsNewWindow(AppObject appobj) { string winid = appobj.GetFileFriendlySignature() + "#dashboard#" + IOTool.NormalizePath(AddonFileName); if (MainWindow.Instance.HasContent(winid)) { MainWindow.Instance.ActivateContent(winid); return; } var pars = new DashboardInstanceParams { LayoutName = appobj.GetFileFriendlySignature() }; var win = CreateControl(pars) as DashboardFrame; if (win == null) { return; } win.SetSelectedObject(appobj); win.WinId = winid; MainWindow.Instance.OpenContent(win); }
private Control GetDashboardControl(DashboardBase dab) { if (!m_dashboardControls.ContainsKey(dab) || m_dashboardControls[dab].IsDisposed) { var pars = new DashboardInstanceParams { LayoutName = ".summary" }; var ctrl = dab.CreateControl(pars); var cc = ctrl as IConnectionPackHolder; if (cc != null) { cc.ConnPack = ConnPack; } var das = ctrl as DashboardFrame; if (das != null) { das.HideToolbar = true; das.ChangedWidgetSet += das_ChangedWidgetSet; } m_dashboardControls[dab] = ctrl; } return(m_dashboardControls[dab]); }
//protected override void SetSelectedObject(AppObject obj) //{ //} public override Control CreateControl(DashboardInstanceParams pars) { return(new DatAdminInfoDashboardFrame()); }
//public AppObject SelectedObject //{ // get { return m_selectedObject; } // set { SetSelectedObject(value); } //} //protected abstract void SetSelectedObject(AppObject obj); public abstract Control CreateControl(DashboardInstanceParams pars);
//protected override void SetSelectedObject(AppObject obj) //{ //} public override Control CreateControl(DashboardInstanceParams pars) { return(new TabbedDashboardFrame()); }