private void queryWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            Object[] results = e.Result as Object[];

            this.selectedDoc = results[0] as SrcMLFile;
            this.data        = results[1] as List <DataCell>;
            this.categories  = results[2] as SyntaticCategoryDataModel;

            int count = 0;

            if (null != this.data)
            {
                dataGridView1.DataSource = this.data;
                count = this.data.Count;
            }

            if (null != this.categories)
            {
                CategoryTreeNode root = new CategoryTreeNode("All");

                categoryTreeView.BeginUpdate();
                categoryTreeView.Nodes.Clear();
                categoryTreeView.Nodes.Add(root);
                foreach (var category in categories.SyntaticCategories.Keys)
                {
                    var xpath         = categories.SyntaticCategories[category].First().CategoryAsXPath;
                    var categoryCount = categories.SyntaticCategories[category].Count;
                    root.AddCategory(xpath, categoryCount);
                }
                categoryTreeView.SelectedNode = root;
                categoryTreeView.EndUpdate();
            }

            queryingXML         = false;
            runQueryButton.Text = Resources.TestButton;
            progressBar.Value   = 0;
            progressLabel.Text  = "";
            messageLabel.Text   = String.Format("Found {0} items.", count);
            setButtons();
        }
Exemplo n.º 2
0
        public void AddCategory(string category, int count)
        {
            var node = this;

            node.Count += count;
            foreach (var part in category.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (node.Nodes.ContainsKey(part))
                {
                    node = node.Nodes[part] as CategoryTreeNode;
                }
                else
                {
                    var newNode = new CategoryTreeNode(part);
                    node.Nodes.Add(newNode);
                    node = newNode;
                    node.setXPath();
                }
                node.Root   = this;
                node.Count += count;
            }
        }
        private void queryWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            Object[] results = e.Result as Object[];

            this.selectedDoc = results[0] as SrcMLFile;
            this.data = results[1] as List<DataCell>;
            this.categories = results[2] as SyntaticCategoryDataModel;

            int count = 0;

            if (null != this.data)
            {
                dataGridView1.DataSource = this.data;
                count = this.data.Count;
            }

            if (null != this.categories)
            {
                CategoryTreeNode root = new CategoryTreeNode("All");
                
                categoryTreeView.BeginUpdate();
                categoryTreeView.Nodes.Clear();
                categoryTreeView.Nodes.Add(root);
                foreach (var category in categories.SyntaticCategories.Keys)
                {
                    var xpath = categories.SyntaticCategories[category].First().CategoryAsXPath;
                    var categoryCount = categories.SyntaticCategories[category].Count;
                    root.AddCategory(xpath, categoryCount);
                }
                categoryTreeView.SelectedNode = root;
                categoryTreeView.EndUpdate();
            }

            queryingXML = false;
            runQueryButton.Text = Resources.TestButton;
            progressBar.Value = 0;
            progressLabel.Text = "";
            messageLabel.Text = String.Format("Found {0} items.", count);
            setButtons();
        }
Exemplo n.º 4
0
        public void AddCategory(string category, int count)
        {
            var node = this;

            node.Count += count;
            foreach (var part in category.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (node.Nodes.ContainsKey(part))
                {
                    node = node.Nodes[part] as CategoryTreeNode;
                }
                else
                {
                    var newNode = new CategoryTreeNode(part);
                    node.Nodes.Add(newNode);
                    node = newNode;
                    node.setXPath();
                }
                node.Root = this;
                node.Count += count;
            }

        }