Пример #1
0
		public KrystalwareLicense(XmlDocument doc)
		{
			foreach (XmlElement el in doc.DocumentElement.ChildNodes)
			{
				switch (el.Name)
				{
					case "Customer":
						_customerName = el.GetAttribute("Name");

						break;
                    case "OrderId":
                        OrderId = Convert.ToInt32(el.GetAttribute("OrderId"));

                        break;
                    case "Products":
						LicensedProduct[] products = new LicensedProduct[el.ChildNodes.Count];

						int i = 0;

						foreach (XmlElement prodEl in el.ChildNodes)
						{
							products[i] = new LicensedProduct(prodEl);

							i++;
						}

						LicensedProducts = products;

						break;
				}
			}
		}
Пример #2
0
        public KrystalwareLicense(XmlDocument doc)
        {
            foreach (XmlElement el in doc.DocumentElement.ChildNodes)
            {
                switch (el.Name)
                {
                case "Customer":
                    _customerName = el.GetAttribute("Name");

                    break;

                case "OrderId":
                    OrderId = Convert.ToInt32(el.GetAttribute("OrderId"));

                    break;

                case "Products":
                    LicensedProduct[] products = new LicensedProduct[el.ChildNodes.Count];

                    int i = 0;

                    foreach (XmlElement prodEl in el.ChildNodes)
                    {
                        products[i] = new LicensedProduct(prodEl);

                        i++;
                    }

                    LicensedProducts = products;

                    break;
                }
            }
        }