public DependencyProductTreeNode(DependencyProduct dependencyProduct)
 {
     this._dependencyProduct = dependencyProduct;
     this.Tag         = dependencyProduct;
     this.ToolTipText = this.ToString();
     this.Text        = this.ToString();
     this.Name        = dependencyProduct.ToString();
 }
Esempio n. 2
0
        private void btnRemove_Click(object sender, System.EventArgs e)
        {
            DependencyProduct         product               = this.lbSelected.SelectedItem as DependencyProduct;
            ProductTreeNode           productNode           = this.tvProducts.Nodes[product.Name] as ProductTreeNode;
            DependencyProductTreeNode dependencyProductNode = productNode.Nodes[product.ToString()] as DependencyProductTreeNode;

            this.tvProducts.SelectedNode  = dependencyProductNode;
            dependencyProductNode.Checked = false;
        }
Esempio n. 3
0
        public static DependencyProduct Load(XmlElement xmlElement)
        {
            if (!xmlElement.Name.Equals("DependencyProduct"))
            {
                return(null);
            }

            XmlAttribute name    = xmlElement.Attributes["Name"];
            XmlAttribute version = xmlElement.Attributes["Version"];

            DependencyProduct dependencyProduct = new DependencyProduct(name.Value, version.Value);

            return(dependencyProduct);
        }
Esempio n. 4
0
        private void btnUp_Click(object sender, System.EventArgs e)
        {
            if (this.lbSelected.SelectedIndex == 0)
            {
                return;
            }

            DependencyProduct selected = (this.lbSelected.SelectedItem as DependencyProduct);

            int aux = (this.lbSelected.SelectedItem as DependencyProduct).Order;

            (this.lbSelected.SelectedItem as DependencyProduct).Order = (this.lbSelected.Items[this.lbSelected.SelectedIndex - 1] as DependencyProduct).Order;
            (this.lbSelected.Items[this.lbSelected.SelectedIndex - 1] as DependencyProduct).Order = aux;

            this.UpdateSelectedVersions();
            this.lbSelected.SelectedItem = selected;
        }
Esempio n. 5
0
        private void LoadProductVersions(ProductTreeNode productNode)
        {
            List <Version> versions       = this.LoadVersions(productNode.Product);
            List <Version> sortedVersions = this.SortVersions(versions);

            foreach (Version version in sortedVersions)
            {
                DependencyProduct         dependencyProduct = this.LoadDependencyProduct(productNode.Product.Name, version);
                DependencyProductTreeNode node = new DependencyProductTreeNode(dependencyProduct);

                node.Checked = this.BetaData.DependencyProducts.Contains(productNode.Product.Name, version.VersionNumber);

                productNode.Nodes.Add(node);
            }

            productNode.ExpandAll();

            this.UpdateSelectedVersions();
        }
Esempio n. 6
0
        private void tvProducts_AfterCheck(object sender, TreeViewEventArgs e)
        {
            if (this.tvProducts.SelectedNode is DependencyProductTreeNode)
            {
                DependencyProductTreeNode node = this.tvProducts.SelectedNode as DependencyProductTreeNode;
                DependencyProduct         dependencyProduct = node.Product;

                if (!this.tvProducts.SelectedNode.Checked)
                {
                    this.BetaData.DependencyProducts.Remove(dependencyProduct);
                }
                else
                {
                    this.BetaData.DependencyProducts.Add(dependencyProduct);
                }
            }

            this.UpdateSelectedVersions();
            this.UpdateControls();
        }
Esempio n. 7
0
        private DependencyProduct LoadDependencyProduct(string product, Version version)
        {
            DependencyProduct dependencyProduct;

            bool contains = this.BetaData.DependencyProducts.Contains(product, version.VersionNumber);

            if (!contains)
            {
                dependencyProduct = new DependencyProduct(product, version.VersionNumber);
            }
            else
            {
                dependencyProduct =
                    this.BetaData.DependencyProducts.ToList().Find(
                        new System.Predicate <DependencyProduct>(p =>
                                                                 p.Name.Equals(product) &&
                                                                 p.Version.Equals(version.VersionNumber)));
            }

            return(dependencyProduct);
        }