private void AddToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem tsmi = sender as ToolStripMenuItem; if (tsmi != null) { Common.Definition.ConstValue.DBViewerFormType frmType = (Common.Definition.ConstValue.DBViewerFormType)tsmi.Tag; if (frmType.Equals(Common.Definition.ConstValue.DBViewerFormType.SqlWindow)) { this.tsBtn_Click(this.mTsBtnSqlWindow, null); } else if (frmType.Equals(Common.Definition.ConstValue.DBViewerFormType.SchemaBrowser)) { this.tsBtn_Click(this.mTsBtnSchemaBrowser, null); } else if (frmType.Equals(Common.Definition.ConstValue.DBViewerFormType.SessionViewer)) { this.tsBtn_Click(this.mTsBtnSessionView, null); } else if (frmType.Equals(Common.Definition.ConstValue.DBViewerFormType.TableSpaceViewer)) { this.tsBtn_Click(this.mTsBtnTableSpaceView, null); } } }
private void MdiChildFormActivated(object sender, EventArgs e) { Form senderFrm = sender as Form; if (senderFrm != null) { Common.Definition.ConstValue.DBViewerFormType frmType = (Common.Definition.ConstValue.DBViewerFormType)senderFrm.Tag; foreach (ToolStripButton tsb in this.tsSub.Items) { if (tsb.Tag != null) { if (tsb.Tag.Equals(frmType)) { tsb.Checked = true; } else { tsb.Checked = false; } } } this.AddToolStripMenuItemByFormType(senderFrm); } }
private void MdiChildFormClosing(object sender, FormClosingEventArgs e) { Form senderFrm = sender as Form; if (senderFrm != null) { Common.Definition.ConstValue.DBViewerFormType frmType = (Common.Definition.ConstValue.DBViewerFormType)senderFrm.Tag; if (frmType.Equals(Common.Definition.ConstValue.DBViewerFormType.SqlWindow)) { if (this.tsSub.Items.Contains(this.mTsBtnSqlWindow)) { this.tsSub.Items.Remove(this.mTsBtnSqlWindow); } } else if (frmType.Equals(Common.Definition.ConstValue.DBViewerFormType.SchemaBrowser)) { if (this.tsSub.Items.Contains(this.mTsBtnSchemaBrowser)) { this.tsSub.Items.Remove(this.mTsBtnSchemaBrowser); } } else if (frmType.Equals(Common.Definition.ConstValue.DBViewerFormType.SessionViewer)) { if (this.tsSub.Items.Contains(this.mTsBtnSessionView)) { this.tsSub.Items.Remove(this.mTsBtnSessionView); } } else if (frmType.Equals(Common.Definition.ConstValue.DBViewerFormType.TableSpaceViewer)) { if (this.tsSub.Items.Contains(this.mTsBtnTableSpaceView)) { this.tsSub.Items.Remove(this.mTsBtnTableSpaceView); } } this.DelToolStripMenuItemByFormType(frmType); } }
private void DelToolStripMenuItemByFormType(Common.Definition.ConstValue.DBViewerFormType aFormType) { for (int itemCnt = 0; itemCnt < this.창ToolStripMenuItem.DropDownItems.Count; itemCnt++) { if (!this.창ToolStripMenuItem.DropDownItems[itemCnt].GetType().Equals(typeof(ToolStripMenuItem))) { continue; } ToolStripMenuItem mi = this.창ToolStripMenuItem.DropDownItems[itemCnt] as ToolStripMenuItem; mi.Checked = false; if (mi.Tag != null) { if (mi.Tag.Equals(aFormType)) { this.창ToolStripMenuItem.DropDownItems.Remove(mi); return; } } } }