private void ultraTabbedMdiManager1_InitializeTab(object sender, Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs e)
        {
            // initialize the mdi tabs key as appropriate.
            frmContent frmContent = e.Tab.Form as frmContent;

            if (frmContent == null)
            {
                if (e.Tab.Form is frmContentEmpty)
                {
                    e.Tab.Key = CONTENTEMPTY;
                }
                return;
            }

            switch (frmContent.ContentType)
            {
            case OutlookCRM.Enums.ContentType.Customers:
                e.Tab.Key = CUSTOMERS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Customers"));
                break;

            case OutlookCRM.Enums.ContentType.Orders:
                e.Tab.Key = ORDERS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Orders"));
                break;

            case OutlookCRM.Enums.ContentType.OrderDetails:
                e.Tab.Key = ORDERDETAILS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Properties.Resources.OrderDetails);
                break;

            case OutlookCRM.Enums.ContentType.ProductSales:
                e.Tab.Key = PRODUCTS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Products"));
                break;

            case OutlookCRM.Enums.ContentType.SalesByCategory:
                e.Tab.Key = CATEGORIES;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Categories"));
                break;

            case OutlookCRM.Enums.ContentType.Shippers:
                e.Tab.Key = SHIPPERS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Shippers"));
                break;

            default:
                break;
            }

            // set the AutoStatus text for the status bar when over the parts of the content form.
            this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, frmContent.GetStatusBarTextGrid());
            this.ultraStatusBar1.SetStatusBarText(frmContent.Chart1, frmContent.GetStatusBarTextChart1());
            this.ultraStatusBar1.SetStatusBarText(frmContent.Chart2, frmContent.GetStatusBarTextChart2());
            this.ultraStatusBar1.SetStatusBarText(frmContent.Chart3, frmContent.GetStatusBarTextChart3());
        }
        private void ultraExplorerBar1_ItemClick(object sender, Infragistics.Win.UltraWinExplorerBar.ItemEventArgs e)
        {
            #region progress
            // show a progress bar in the status bar
            if (this.progressTimer != null && this.ProgressPanel != null && this.ProgressPanelLabel != null)
            {
                this.progressTimer.Stop();
                this.progressPanel.ProgressBarInfo.Value = this.progressPanel.ProgressBarInfo.Minimum;
                this.progressPanelLabel.Text             = string.Format("{0}: {1}%", Utilities.GetLocalizedString("Updating"), this.progressPanel.ProgressBarInfo.Value);
                this.progressTimer.Start();
            }
            #endregion // progress

            frmContent frmContent = null;
            MdiTab     mdiTab     = null;

            // get the appropriate content form instance.  If there is no instance yet, create one of the appropriate content type.
            switch (e.Item.Key)
            {
            case CUSTOMERS:
                mdiTab     = this.ultraTabbedMdiManager1.TabFromKey(CUSTOMERS);
                frmContent = mdiTab == null
                                     ? new frmContent(OutlookCRM.Enums.ContentType.Customers)
                {
                    MdiParent = this
                }
                                     : mdiTab.Form as frmContent;
                break;

            case ORDERS:
                mdiTab     = this.ultraTabbedMdiManager1.TabFromKey(ORDERS);
                frmContent = mdiTab == null
                                     ? new frmContent(OutlookCRM.Enums.ContentType.Orders)
                {
                    MdiParent = this
                }
                                     : mdiTab.Form as frmContent;
                break;

            case ORDERDETAILS:
                mdiTab     = this.ultraTabbedMdiManager1.TabFromKey(ORDERDETAILS);
                frmContent = mdiTab == null
                                     ? new frmContent(OutlookCRM.Enums.ContentType.OrderDetails)
                {
                    MdiParent = this
                }
                                     : mdiTab.Form as frmContent;
                break;

            case PRODUCTS:
                mdiTab     = this.ultraTabbedMdiManager1.TabFromKey(PRODUCTS);
                frmContent = mdiTab == null
                                     ? new frmContent(OutlookCRM.Enums.ContentType.ProductSales)
                {
                    MdiParent = this
                }
                                     : mdiTab.Form as frmContent;
                break;

            case CATEGORIES:
                mdiTab     = this.ultraTabbedMdiManager1.TabFromKey(CATEGORIES);
                frmContent = mdiTab == null
                                     ? new frmContent(OutlookCRM.Enums.ContentType.SalesByCategory)
                {
                    MdiParent = this
                }
                                     : mdiTab.Form as frmContent;
                break;

            case SHIPPERS:
                mdiTab     = this.ultraTabbedMdiManager1.TabFromKey(SHIPPERS);
                frmContent = mdiTab == null
                                     ? new frmContent(OutlookCRM.Enums.ContentType.Shippers)
                {
                    MdiParent = this
                }
                                     : mdiTab.Form as frmContent;
                break;

            default:
                mdiTab = this.ultraTabbedMdiManager1.TabFromKey(CONTENTEMPTY);
                frmContentEmpty frmContentEmpty = mdiTab == null
                                     ? new frmContentEmpty()
                {
                    MdiParent = this
                }
                                     : mdiTab.Form as frmContentEmpty;
                if (frmContentEmpty != null)
                {
                    frmContentEmpty.Show();
                    frmContentEmpty.Activate();
                }
                break;
            }
            if (frmContent != null)
            {
                // show and activate the appropriate instance of the content form.
                frmContent.Show();
                frmContent.Activate();
            }
        }
        private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
        {
            frmContent frmContent = this.ActiveMdiChild as frmContent;

            switch (e.Tool.Key)
            {
                #region NOT IMPLEMENTED

            case "btnNewCustomer":        // ButtonTool
                // Place code here
                break;

            case "btnEdit":        // ButtonTool
                // Place code here
                break;

            case "btnDuplicate":        // ButtonTool
                // Place code here
                break;

            case "btnDelete":        // ButtonTool
                // Place code here
                break;

            case "btnMerge":        // ButtonTool
                // Place code here
                break;

            case "btnDetectDuplicates":        // ButtonTool
                // Place code here
                break;

            case "btnSendEmail":        // ButtonTool
                // Place code here
                break;

            case "btnNewMeeting":        // ButtonTool
                // Place code here
                break;

            case "btnRunWorkflow":        // ButtonTool
                // Place code here
                break;

            case "btnStartDialog":        // ButtonTool
                // Place code here
                break;

            case "btnImportData":        // ButtonTool
                // Place code here
                break;

            case "btnAdvancedFind":        // ButtonTool
                // Place code here
                break;

            case "btnRunReport":        // PopupMenuTool
                // Place code here
                break;

            case "btnCall":        // ButtonTool
                // Place code here
                break;

            case "btnPrint":        // ButtonTool
                // Place code here
                break;

            case "pmtOptions":        // PopupMenuTool
                // Place code here
                break;

            case "pccAbout":        // PopupControlContainerTool
                // Place code here
                break;

                #endregion // NOT IMPLEMENTED

                #region Export buttons

            case "btnExcel":        // ButtonTool
                if (frmContent == null)
                {
                    return;
                }
                if (frmContent.Grid.IsExportAsyncInProgress)
                {
                    MessageBox.Show(Properties.Resources.ExportInProgressMessage);
                    return;
                }

                // export the grid to excel.
                this.ultraGridExcelExporter1.ExportAsync(frmContent.Grid, Application.StartupPath + @"\ExcelExport.xls");
                break;

            case "btnPDF":        // ButtonTool
                if (frmContent == null)
                {
                    return;
                }
                if (frmContent.Grid.IsExportAsyncInProgress)
                {
                    MessageBox.Show(Properties.Resources.ExportInProgressMessage);
                    return;
                }

                this.gridExportFormat = GridExportFileFormat.PDF;
                // export the grid to pdf.
                this.ultraGridDocumentExporter1.ExportAsync(frmContent.Grid, Application.StartupPath + @"\pdfExport.pdf", Infragistics.Win.UltraWinGrid.DocumentExport.GridExportFileFormat.PDF);
                break;

            case "btnXPS":        // ButtonTool
                if (frmContent == null)
                {
                    return;
                }
                if (frmContent.Grid.IsExportAsyncInProgress)
                {
                    MessageBox.Show(Properties.Resources.ExportInProgressMessage);
                    return;
                }
                this.gridExportFormat = GridExportFileFormat.XPS;
                // export the grid to xps.
                this.ultraGridDocumentExporter1.ExportAsync(frmContent.Grid, Application.StartupPath + @"\xpsExport.xps", Infragistics.Win.UltraWinGrid.DocumentExport.GridExportFileFormat.XPS);
                break;

                #endregion // Export buttons

                #region View -> Layout ListItems

            case "listPaneLayout":        // ListTool
                if (frmContent == null)
                {
                    return;
                }
                // toggle the pane layout.
                switch (e.ListToolItem.Key)
                {
                case "Right":
                    frmContent.SetPaneLayout(Enums.PaneLayout.Right);
                    break;

                case "Bottom":
                    frmContent.SetPaneLayout(Enums.PaneLayout.Bottom);
                    break;

                case "Off":
                    frmContent.SetPaneLayout(Enums.PaneLayout.Off);
                    break;

                default:
                    break;
                }
                break;

                #endregion // View -> Layout ListItems

                #region Exit
            case "btnExit":        // ButtonTool
                Application.Exit();
                break;
                #endregion // Exit

            default:
                break;
            }
        }