void BindActiveTabEvents(EditingTabController cont) { if (cont == null) return; cont.RowCountChange += new EditingTabController.RowCountChangeDelegate(QueryWindowForm_RowCountChange); cont.ExecController.Start += new StatementExecutionController.StartDelegate(_execController_Start); cont.ExecController.End += new StatementExecutionController.EndDelegate(_execController_End); }
void Connect(EditingTabController cont) { NewConnectionForm f = new NewConnectionForm(); if (DialogResult.OK == f.ShowDialog()) { if (_editingTabList.Count == 0) FileNewCommand(); cont.ExecController.Connection = f.Connection.OpenConnection; cont.Connection = f.Connection; cont.UpdateTabTitle(); } }
private void FileOpenCommand(string filename) { EditingTabController c; bool toadd = true; if (filesTabControl.TabCount > 0) { c = _editingTabList[filesTabControl.SelectedTab]; if (!(c.IsEmpty && c.FileName == null)) c = new EditingTabController(); else toadd = false; } else c = new EditingTabController(); c.FileName = filename; c.UpdateTabTitle(); TabPage tab = c.Tab; if (toadd) { filesTabControl.TabPages.Add(tab); _editingTabList.Add(c.Tab, c); filesTabControl.SelectedTab = tab; } c.Reload(); }
private void FileNewCommand() { EditingTabController c = new EditingTabController(); c.FileName = null; TabPage tab = c.Tab; tab.Text = SR.NewFile + (filesTabControl.TabPages.Count + 1); filesTabControl.TabPages.Add(tab); _editingTabList.Add(c.Tab, c); filesTabControl.SelectedTab = tab; c.Reload(); }