private void OpenDocument(BaseItem bi) { BalloonSearch bs = new BalloonSearch(); bs.Owner = this; bs.Show(bi, true); return; }
private void CloseSearch() { if (m_Search != null) { m_Search.Close(); m_Search.Dispose(); m_Search = null; } }
private void BarItemClick(object sender, EventArgs e) { BaseItem objItem = sender as BaseItem; frmDocument activedocument = this.ActiveMdiChild as frmDocument; switch (objItem.Name) { // File menu case "bNew": CreateNewDocument(); break; case "bTaskNewDocument": CreateNewDocument(); break; case "bOpen": OpenDocument(); break; case "bTaskOpenDocument": OpenDocument(); break; case "bSave": SaveDocument(); break; case "bSaveAs": SaveDocumentAs(); break; case "bClose": { if (activedocument != null) { activedocument.Close(); } break; } case "bPageSetup": MessageBox.Show("Not implemented yet."); break; case "bPrintPreview": MessageBox.Show("Not implemented yet."); break; case "bPrint": MessageBox.Show("Not implemented yet."); break; case "bExit": this.Close(); break; // Window menu case "bArrangeAll": this.LayoutMdi(MdiLayout.Cascade); break; case "bNewWindow": goto case "bNew"; case "window_list": ((Form)objItem.Tag).Activate(); break; // Style switching case "bSwitchStyle": dotNetBarManager1.Style = (objItem.Style == eDotNetBarStyle.Office2000)?eDotNetBarStyle.OfficeXP:eDotNetBarStyle.Office2000; break; case "bTaskNewFromExisting": MessageBox.Show("Not implemented."); break; case "bTaskHelp": MessageBox.Show("Starts the help file."); break; case "bTaskSampleDoc": MessageBox.Show("This is only a sample item that when clicked should open most recently used document."); break; case "bThemes": EnableThemes((ButtonItem)objItem); break; case "bTabbedMdi": { ButtonItem button = objItem as ButtonItem; SwitchWorkingMode(!button.Checked); button.Checked = !button.Checked; break; } case "bStyle2000": ChangeDotNetBarStyle(eDotNetBarStyle.Office2000); break; case "bStyle2003": ChangeDotNetBarStyle(eDotNetBarStyle.Office2003); break; case "bStyleXP": ChangeDotNetBarStyle(eDotNetBarStyle.OfficeXP); break; case "bFind": { if (m_Search == null || m_Search.IsDisposed) { m_Search = new BalloonSearch(); m_Search.Owner = this; m_Search.Show(objItem, true); } break; } default: { // Pass them to the active document if (activedocument != null) { activedocument.ExecuteCommand(objItem.Name, null); } break; } } }