Exemplo n.º 1
0
        private void FireQueryModel(IExecutionItem executionItem)
        {
            if (executionItem == null)
            {
                return;
            }

            Cursor current = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;

            tbConsole.Clear();
            tbConsole.Refresh();
            Console.Clear();

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();
            IList data = executionItem.Execute();

            stopWatch.Stop();

            dgResult.Text            = executionItem.ToString();
            dgResult.DataSource      = data;
            dgResult.CellFormatting += DgResultOnCellFormatting;

            int    count          = data.Count;
            double totalSeconds   = stopWatch.Elapsed.TotalSeconds;
            int    countPerSecond = (int)(count / totalSeconds);

            this.Text = string.Format("Count: {0}, Time: {1}, CountPerSecond: {2}", count, totalSeconds, countPerSecond);

            Cursor.Current = current;
        }
Exemplo n.º 2
0
        private void FireQueryModel(IExecutionItem executionItem)
        {
            if (executionItem == null)
                return;

            Cursor current = Cursor.Current;
            Cursor.Current = Cursors.WaitCursor;

            tbConsole.Clear();
            tbConsole.Refresh();
            Console.Clear();

            Stopwatch stopWatch = new Stopwatch();
            stopWatch.Start();
            IList data = executionItem.Execute();
            stopWatch.Stop();

            dgResult.Text = executionItem.ToString();
            dgResult.DataSource = data;
            dgResult.CellFormatting += DgResultOnCellFormatting;

            int count = data.Count;
            double totalSeconds = stopWatch.Elapsed.TotalSeconds;
            int countPerSecond = (int)(count / totalSeconds);
            this.Text = string.Format("Count: {0}, Time: {1}, CountPerSecond: {2}", count, totalSeconds, countPerSecond);

            Cursor.Current = current;
        }
Exemplo n.º 3
0
        private TreeNode BuildTreeNode(IExecutionItem executionItem)
        {
            TreeNode node = new TreeNode(executionItem.ToString());

            node.Tag = executionItem;
            return(node);
        }
Exemplo n.º 4
0
 private TreeNode BuildTreeNode(IExecutionItem executionItem)
 {
     TreeNode node = new TreeNode(executionItem.ToString());
     node.Tag = executionItem;
     return node;
 }