상속: System.Windows.Forms.Form
예제 #1
0
        private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (sqlListView.SelectedItems.Count > 0)
            {
                var selectedItem = sqlListView.SelectedItems[0];
                if (selectedItem.Tag != null)
                {
                    if (selectedItem.Tag.GetType().Equals(typeof(SQLByFrom)))
                    {
                        var form = new SQLViewer(this,traceData.SQLStatements, (SQLByFrom)selectedItem.Tag);
                        _currentModal = form;
                        form.ShowDialog(this);
                    }
                    if (selectedItem.Tag.GetType().Equals(typeof(SQLByWhere)))
                    {
                        var form = new SQLViewer(this,traceData.SQLStatements, (SQLByWhere)selectedItem.Tag);
                        _currentModal = form;
                        form.ShowDialog(this);
                    }

                    if (selectedItem.Tag.GetType().Equals(typeof(SQLStatement)))
                    {
                        GoToSQLStatementInExecPath((SQLStatement)(selectedItem.Tag));
                    }
                }
            }

        }
예제 #2
0
        private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (sqlListView.SelectedItems.Count > 0)
            {
                var selectedItem = sqlListView.SelectedItems[0];
                if (selectedItem.Tag != null)
                {
                    if (selectedItem.Tag.GetType().Equals(typeof(SQLByFrom)))
                    {
                        var form = new SQLViewer(this, traceData.SQLStatements, (SQLByFrom)selectedItem.Tag);
                        _currentModal = form;
                        form.ShowDialog(this);
                    }
                    if (selectedItem.Tag.GetType().Equals(typeof(SQLByWhere)))
                    {
                        var form = new SQLViewer(this, traceData.SQLStatements, (SQLByWhere)selectedItem.Tag);
                        _currentModal = form;
                        form.ShowDialog(this);
                    }

                    if (selectedItem.Tag.GetType().Equals(typeof(SQLStatement)))
                    {
                        if (IsRunningMono)
                        {
                            var callDepth = 0;
                            var sqlStatement = selectedItem.Tag as SQLStatement;
                            var parent = sqlStatement.ParentCall;
                            while (parent != null)
                            {
                                callDepth++;
                                parent = parent.Parent;
                            }
                            if (callDepth > 10)
                            {
                                var result = MessageBox.Show("Due to poor performance of TreeView in Mono, this may take some time (depending on how nested the SQL statement is), would you like to continue?.", "Long operation", MessageBoxButtons.YesNo);
                                if (result == DialogResult.No)
                                {
                                    return;
                                }
                            }
                        }
                        GoToSQLStatementInExecPath((SQLStatement)(selectedItem.Tag));
                    }
                }
            }

        }