Skip to content

Instantly share code, notes, and snippets.

@hasokeric
Created May 3, 2018 12:56
Show Gist options
  • Save hasokeric/d31594513c65489ffaf90f4893786678 to your computer and use it in GitHub Desktop.
Save hasokeric/d31594513c65489ffaf90f4893786678 to your computer and use it in GitHub Desktop.
Epicor 10 Dashboard Customization to Hide/Show Bottom Panel on Other Tabs. Not IDEAL, could use some refactoring and cleanup - but a quick hack.
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
public class Script
{
// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
// Begin Wizard Added Module Level Variables **
// End Wizard Added Module Level Variables **
// Add Custom Module Level Variables Here **
public Infragistics.Win.UltraWinDock.UltraDockManager udm;
public Ice.UI.App.SMI_CheckRegister.V_SMI_DB_CheckRegisterDetails_2ViewDockPanel2 mpanel2;
public Infragistics.Win.UltraWinDock.DockableWindow dockWindow;
public Infragistics.Win.UltraWinDock.DockableControlPane dockPane;
public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
Ice.UI.App.SMI_CheckRegister.V_SMI_DB_CheckRegisterSummary_1ViewDockPanel1 mpanel3 = ((Ice.UI.App.SMI_CheckRegister.V_SMI_DB_CheckRegisterSummary_1ViewDockPanel1)csm.GetNativeControlReference("c881fd61-e3af-4513-b6dc-e000426ac9eb"));
Infragistics.Win.UltraWinDock.DockableWindow maindock = (Infragistics.Win.UltraWinDock.DockableWindow) mpanel3.Parent;
udm = ((Infragistics.Win.UltraWinDock.DockablePaneBase)(((Infragistics.Win.UltraWinDock.DockableControlPane)((Infragistics.Win.UltraWinDock.DockableWindow)(maindock)).Pane))).Manager;
udm.PaneDisplayed += new Infragistics.Win.UltraWinDock.PaneDisplayedEventHandler(this.ultraDockManager1_PaneActivate);
// End Wizard Added Custom Method Calls
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
udm.PaneDisplayed -= new Infragistics.Win.UltraWinDock.PaneDisplayedEventHandler(this.ultraDockManager1_PaneActivate);
// End Custom Code Disposal
}
private void ultraDockManager1_PaneActivate(object sender, Infragistics.Win.UltraWinDock.PaneDisplayedEventArgs e)
{
// This event provides a notification when the active pane
// (see the ActivePane property of the UltraDockManager)
// has been changed. a pane may be activated programatically
// by calling the pane's activate method or by giving focus
// to a control contained within the dockable control pane.
//MessageBox.Show( "Pane! " + e.Pane.Key);
// Could be refactored, but minor risk
this.mpanel2 = ((Ice.UI.App.SMI_CheckRegister.V_SMI_DB_CheckRegisterDetails_2ViewDockPanel2)csm.GetNativeControlReference("f96a7a9f-096e-49b7-a235-956f6cf0ea54"));
this.dockWindow = (Infragistics.Win.UltraWinDock.DockableWindow) mpanel2.Parent;
this.dockPane = (Infragistics.Win.UltraWinDock.DockableControlPane) dockWindow.Pane;
switch (e.Pane.Text)
{
case "All Transactions":
this.dockPane.Close();
break;
default:
this.dockPane.Show();
break;
}
//((Epicor.Mfg.UI.FrameWork.EpiBasePanel)e.Pane.Control).Controls.Add(web_view);
}
private void MainController_Load(object sender, EventArgs args)
{
// Add Event Handler Code
this.MainController.WindowState = FormWindowState.Maximized;
}
}
/* EOF */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment