public IToolBar Add(string id) { ToolStrip toolStrip = new ToolStrip(); toolStrip.Text = id; ToolStripPanel toolStripPanel = m_toolStripContainer.TopToolStripPanel; toolStripPanel.Controls.Add(toolStrip); ToolBarBridge toolBarBridge = new ToolBarBridge(toolStrip, false); m_toolBars.Add(toolBarBridge); return(toolBarBridge); }
public void Remove(IToolBar toolBar) { ToolBarBridge toolBarBridge = (ToolBarBridge)toolBar; if (!m_toolBars.Contains(toolBarBridge)) { throw new Exception("Cannot remove a toolbar that is not in the tool strip container"); } if (toolBar.ReadOnly) { throw new Exception("Cannot remove a built-in toolbar"); } ToolStrip toolStrip = toolBarBridge.ToolStrip; toolStrip.Parent.Controls.Remove(toolStrip); m_toolBars.Remove(toolBarBridge); }
public IToolBar Add(string id) { ToolStrip toolStrip = new ToolStrip(); toolStrip.Text = id; ToolStripPanel toolStripPanel = m_toolStripContainer.TopToolStripPanel; toolStripPanel.Controls.Add(toolStrip); ToolBarBridge toolBarBridge = new ToolBarBridge(toolStrip, false); m_toolBars.Add(toolBarBridge); return toolBarBridge; }