Exemplo n.º 1
0
        private void tsBtn_Click(object sender, MouseEventArgs e)
        {
            ToolStripButton tsBtn = sender as ToolStripButton;

            tsBtn.Checked = true;

            foreach (ToolStripButton abtn in tsBtn.GetCurrentParent().Items)
            {
                if (!abtn.Equals(tsBtn))
                {
                    abtn.Checked = false;
                }
            }

            if (tsBtn.Equals(this.mTsBtnSqlWindow))
            {
                frmSQLWindow window = new frmSQLWindow();
                window.Tag = Common.Definition.ConstValue.DBViewerFormType.SqlWindow;

                this.ShowFormORClose(window);
            }
            else if (tsBtn.Equals(this.mTsBtnSchemaBrowser))
            {
                frmSchemaBrowser browser = new frmSchemaBrowser();
                browser.Tag = Common.Definition.ConstValue.DBViewerFormType.SchemaBrowser;

                this.ShowFormORClose(browser);
            }
            else if (tsBtn.Equals(this.mTsBtnSessionView))
            {
                frmSessionView sessionView = new frmSessionView();
                sessionView.Tag = Common.Definition.ConstValue.DBViewerFormType.SessionViewer;

                this.ShowFormORClose(sessionView);
            }
            else if (tsBtn.Equals(this.mTsBtnTableSpaceView))
            {
                frmTableSpaceView tableSpaceView = new frmTableSpaceView();
                tableSpaceView.Tag = Common.Definition.ConstValue.DBViewerFormType.TableSpaceViewer;

                this.ShowFormORClose(tableSpaceView);
            }
        }
Exemplo n.º 2
0
        private void tsbtnSqlWindow_Click(object sender, EventArgs e)
        {
            ToolStripButton tsBtn = sender as ToolStripButton;

            if (tsBtn.Equals(this.tsbtnSqlWindow))
            {
                if (!this.tsSub.Items.Contains(this.mTsBtnSqlWindow))
                {
                    this.tsSub.Items.Add(this.mTsBtnSqlWindow);
                }

                this.tsBtn_Click(this.mTsBtnSqlWindow, null);
            }
            else if (tsBtn.Equals(this.tsbtnSchemaBrowser))
            {
                if (!this.tsSub.Items.Contains(this.mTsBtnSchemaBrowser))
                {
                    this.tsSub.Items.Add(this.mTsBtnSchemaBrowser);
                }

                this.tsBtn_Click(this.mTsBtnSchemaBrowser, null);
            }
            else if (tsBtn.Equals(this.tsbtnSessionView))
            {
                if (!this.tsSub.Items.Contains(this.mTsBtnSessionView))
                {
                    this.tsSub.Items.Add(this.mTsBtnSessionView);
                }

                this.tsBtn_Click(this.mTsBtnSessionView, null);
            }
            else if (tsBtn.Equals(this.tsbtnTableSpaceViewer))
            {
                if (!this.tsSub.Items.Contains(this.mTsBtnTableSpaceView))
                {
                    this.tsSub.Items.Add(this.mTsBtnTableSpaceView);
                }

                this.tsBtn_Click(this.mTsBtnTableSpaceView, null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Disable all tool strip buttons exluded paste.
        /// </summary>
        private void DisableToolStripButtons()
        {
            foreach (ToolStripItem item in toolStrip.Items)
            {
                ToolStripButton button = item as ToolStripButton;

                if (button != null && !button.Equals(this.pasteToolStripButton))
                {
                    button.Enabled = false;
                }
            }
        }
Exemplo n.º 4
0
        public void EnableToolStripButtons()
        {
            foreach (ToolStripItem item in toolStrip.Items)
            {
                ToolStripButton button = item as ToolStripButton;

                if (button != null && !button.Equals(this.pasteToolStripButton))
                {
                    button.Enabled = true;
                }
            }
        }
Exemplo n.º 5
0
        private void tsbtnRDP_Click(object sender, EventArgs e)
        {
            ToolStripButton tsBtn = sender as ToolStripButton;

            if (tsBtn != null)
            {
                if (tsBtn.Equals(this.tsbtnRDP))
                {
                    frmRDPMain window = new frmRDPMain();
                    //window.Tag = Common.Definition.ConstValue.DBViewerFormType.SqlWindow;

                    this.ShowFormORClose(window);
                }
            }
        }
Exemplo n.º 6
0
        private void tsbtnExecuteQuery_Click(object sender, EventArgs e)
        {
            ToolStripButton tsbtn = sender as ToolStripButton;

            if (tsbtn != null)
            {
                if (tsbtn.Equals(this.tsbtnExecuteQuery))
                {
                    ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;
                    query.ExecuteQuery(false, 0, false);
                }
                else if (tsbtn.Equals(this.tsbtnAddTab))
                {
                    this.tabControl1.TabPages.Add("SQL");
                    this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1;

                    ucQuery query = new ucQuery();
                    query.Dock = DockStyle.Fill;
                    this.tabControl1.SelectedTab.Controls.Add(query);
                    this.tabControl1.SelectedTab.Tag = query;
                    query.SetFocusDDLBox();

                    this.SetCtrlEnabledByTabPageCnt();
                }
                else if (tsbtn.Equals(this.tsbtnRemoveTab))
                {
                    if (this.tabControl1.TabPages.Count > 0)
                    {
                        this.tabControl1.TabPages.Remove(this.tabControl1.SelectedTab);
                        this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1;
                    }

                    this.SetCtrlEnabledByTabPageCnt();
                }
                else if (tsbtn.Equals(this.tsbtnCommit))
                {
                    Common.Comm.DBWorker.CommitTrans();

                    ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;
                    query.SetCtrlProp_Committed();
                }
                else if (tsbtn.Equals(this.tsbtnRollback))
                {
                    Common.Comm.DBWorker.RollbackTrans();

                    ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;
                    query.SetCtrlProp_Rollbacked();
                }
                else if (tsbtn.Equals(this.tsbtnExportExcel))
                {
                    ucQuery query = this.tabControl1.SelectedTab.Tag as ucQuery;
                    query.ExportExcelQueryResult();
                }
            }
        }
Exemplo n.º 7
0
        private void miFromList_Click(object sender, EventArgs e)
        {
            ToolStripButton mi      = (ToolStripButton)sender;
            ToolStripButton miOther = mi.Equals(miFromList) ? miFromAndToList : miFromList;

            if (mi.Checked)
            {
                mi.Checked = false;
            }
            else if (miOther.Checked) // mi.Checked == false
            {
                miOther.Checked = false;
                mi.Checked      = true;
            }
            else
            {
                mi.Checked = true;
            }
            UpdateListState();
        }
Exemplo n.º 8
0
 //============================================================
 // <T>缩放内容处理。</T>
 //
 // @param sender 发送者
 // @param e 事件
 //============================================================
 private void tsbScale_Click(object sender, EventArgs e)
 {
     foreach (ToolStripItem item in tsResource.Items)
     {
         if (item is ToolStripButton)
         {
             ToolStripButton button = item as ToolStripButton;
             if (!button.Equals(sender))
             {
                 button.Checked = false;
             }
             else
             {
                 button.Checked = true;
             }
         }
     }
     if (null != qpbImage.Bitmap)
     {
         ToolStripButton button     = sender as ToolStripButton;
         string          typeString = button.Tag.ToString();
         if (typeString.Equals("Auto"))
         {
             qpbImage.ScaleMode = EPictureBoxMode.Auto;
             return;
         }
         float scale = RFloat.Parse(button.Tag.ToString());
         if (scale > 1)
         {
             qpbImage.ScaleMode = EPictureBoxMode.ScalePixel;
         }
         else
         {
             qpbImage.ScaleMode = EPictureBoxMode.Scale;
         }
         qpbImage.ScaleValue = scale;
     }
 }
Exemplo n.º 9
0
 private void ClearCheck(ToolStripButton toolStripButton)
 {
     _btnPanTool.Checked      = toolStripButton.Equals(_btnPanTool);
     _btnZoomDrawTool.Checked = toolStripButton.Equals(_btnZoomDrawTool);
 }