示例#1
0
        private void btnDebug_Click(object sender, EventArgs e)
        {
            if (_debugger == null)
            {
                _debugger = new DatabaseDebugger(_db, new Random().Next(8000, 9000));

                _debugger.Start();
            }

            Process.Start("http://localhost:" + _debugger.Port);
        }
示例#2
0
        private void Disconnect()
        {
            foreach (var tab in tabSql.TabPages.Cast <TabPage>().Where(x => x.Name != "+").ToArray())
            {
                var task = tab.Tag as TaskData;
                task.ThreadRunning = false;
                task.WaitHandle.Set();
            }

            // clear all tabs and controls
            tabSql.TabPages.Clear();

            txtSql.Clear();
            grdResult.Clear();
            txtResult.Clear();
            txtParameters.Clear();

            tvwDatabase.Nodes.Clear();

            btnConnect.Text = "Connect";

            this.UIState(false);

            tvwDatabase.Focus();

            tlbMain.Enabled = false;
            lblCursor.Text  = "Closing...";

            try
            {
                _debugger?.Dispose();
                _debugger = null;

                _db?.Dispose();
                _db = null;

                lblCursor.Text  = "";
                tlbMain.Enabled = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }