private void ParseSDP(List <SoftwareDistributionPackage> extractedSDP)
        {
            Logger.EnteringMethod(extractedSDP.Count.ToString());

            foreach (SoftwareDistributionPackage sdp in extractedSDP)
            {
                if (sdp != null)
                {
                    CatalogUpdate newUpdate = new CatalogUpdate(sdp);
                    CatalogVendor newVendor;
                    if (Vendors.ContainsKey(sdp.VendorName))
                    {
                        newVendor = Vendors[sdp.VendorName];
                    }
                    else
                    {
                        newVendor = new CatalogVendor(sdp.VendorName);
                        Vendors.Add(sdp.VendorName, newVendor);
                    }
                    CatalogProduct newProduct;
                    if (newVendor.Products.ContainsKey(sdp.ProductNames[0]))
                    {
                        newProduct = newVendor.Products[sdp.ProductNames[0]];
                    }
                    else
                    {
                        newProduct = new CatalogProduct(sdp.ProductNames[0]);
                        newVendor.AddProduct(newProduct);
                    }
                    newProduct.AddUpdate(newUpdate);
                }
            }
        }
Example #2
0
 private void AddProductToVendor(TreeNode vendorNode, CatalogVendor vendor)
 {
     foreach (CatalogProduct product in vendor.Products.Values)
     {
         TreeNode productNode = new TreeNode(product.ProductName);
         productNode.Tag = new CatalogItem(product);
         vendorNode.Nodes.Add(productNode);
         AddUpdateToProduct(productNode, product);
     }
 }
 internal CatalogItem(CatalogVendor vendor)
 {
     ItemType = CatalogItemTypes.Vendor;
     Vendor = vendor;
 }