public CategoryInfoCollection(CatalogInfo catalogInfo, IEnumerable <XElement> nodes)
 {
     foreach (XElement node in nodes)
     {
         CategoryInfo categoryInfo = new CategoryInfo(catalogInfo, node);
         Add(categoryInfo.Id, categoryInfo);
     }
 }
 public ItemInfoCollection(CatalogInfo catalogInfo, IEnumerable <XElement> nodes)
 {
     foreach (XElement node in nodes)
     {
         ItemInfo itemInfo = new ItemInfo(catalogInfo, node);
         Add(itemInfo.Id, itemInfo);
     }
 }
示例#3
0
        public CategoryInfo(CatalogInfo catalog, XElement node)
        {
            _catalog = catalog;

            string value;

            if (node.TryGetAttributeValue("id", out value))
                _id = int.Parse(value);

            XElement n = node.Element("name");
            if (n != null && n.TryGetValue(out value))
                _name = value;

            n = node.Element("description");
            if (n != null && n.TryGetValue(out value))
                _description = value;
        }
示例#4
0
        public CategoryInfo(CatalogInfo catalog, XElement node)
        {
            _catalog = catalog;

            string value;

            if (node.TryGetAttributeValue("id", out value))
            {
                _id = int.Parse(value);
            }

            XElement n = node.Element("name");

            if (n != null && n.TryGetValue(out value))
            {
                _name = value;
            }

            n = node.Element("description");
            if (n != null && n.TryGetValue(out value))
            {
                _description = value;
            }
        }
示例#5
0
        public ItemInfo(CatalogInfo catalog, XElement node)
        {
            _catalog = catalog;

            string value;

            if (node.TryGetAttributeValue("id", out value))
            {
                _id = int.Parse(value);
            }
            if (node.TryGetAttributeValue("categoryId", out value))
            {
                _categoryId = int.Parse(value);
            }
            if (node.TryGetAttributeValue("creatorId", out value))
            {
                _creatorId = value;
            }

            XElement n = node.Element("name");

            if (n != null && n.TryGetValue(out value))
            {
                _name = value;
            }

            n = node.Element("description");
            if (n != null && n.TryGetValue(out value))
            {
                _description = value;
            }

            n = node.Element("version");
            if (n != null && n.TryGetValue(out value))
            {
                _version = value;
            }

            n = node.Element("downloadUrl");
            if (n != null && n.TryGetValue(out value))
            {
                _downloadUrl = value;
            }

            n = node.Element("fileName");
            if (n != null && n.TryGetValue(out value))
            {
                _fileName = value;
            }

            n = node.Element("screenshotUrl");
            if (n != null && n.TryGetValue(out value))
            {
                _screenshotUrl = value;
            }

            n = node.Element("iconUrl");
            if (n != null && n.TryGetValue(out value))
            {
                _iconUrl = value;
            }

            n = node.Element("worksWithMajorVersion");
            if (n != null && n.TryGetValue(out value))
            {
                _worksWithMajorVersion = int.Parse(value);
            }

            n = node.Element("worksWithMinorVersion");
            if (n != null && n.TryGetValue(out value))
            {
                _worksWithMinorVersion = int.Parse(value);
            }

            n = node.Element("requiresManualIntervention");
            if (n != null && n.TryGetValue(out value))
            {
                _requiresManualIntervention = bool.Parse(value);
            }

            n = node.Element("dateAdded");
            if (n != null && n.TryGetValue(out value))
            {
                _dateAdded = DateTime.Parse(value);
            }

            n = node.Element("statisticsInfo");
            if (n != null)
            {
                _statistics = new StatisticsInfo(n);
            }

            n = node.Element("purchaseInfo");
            if (n != null)
            {
                _purchase = new PurchaseInfo(n);
            }

            n = node.Element("tags");
            if (n != null)
            {
                foreach (XElement e in n.Elements("tag"))
                {
                    string tag;
                    if (e.TryGetValue(out tag))
                    {
                        _tags.Add(tag);
                    }
                }
            }
        }
示例#6
0
        public ItemInfo(CatalogInfo catalog, XElement node)
        {
            _catalog = catalog;

            string value;

            if (node.TryGetAttributeValue("id", out value))
                _id = int.Parse(value);
            if (node.TryGetAttributeValue("categoryId", out value))
                _categoryId = int.Parse(value);
            if (node.TryGetAttributeValue("creatorId", out value))
                _creatorId = value;

            XElement n = node.Element("name");
            if (n != null && n.TryGetValue(out value))
                _name = value;

            n = node.Element("description");
            if (n != null && n.TryGetValue(out value))
                _description = value;

            n = node.Element("version");
            if (n != null && n.TryGetValue(out value))
                _version = value;

            n = node.Element("downloadUrl");
            if (n != null && n.TryGetValue(out value))
                _downloadUrl = value;

            n = node.Element("fileName");
            if (n != null && n.TryGetValue(out value))
                _fileName = value;

            n = node.Element("screenshotUrl");
            if (n != null && n.TryGetValue(out value))
                _screenshotUrl = value;

            n = node.Element("iconUrl");
            if (n != null && n.TryGetValue(out value))
                _iconUrl = value;

            n = node.Element("worksWithMajorVersion");
            if (n != null && n.TryGetValue(out value))
                _worksWithMajorVersion = int.Parse(value);

            n = node.Element("worksWithMinorVersion");
            if (n != null && n.TryGetValue(out value))
                _worksWithMinorVersion = int.Parse(value);

            n = node.Element("requiresManualIntervention");
            if (n != null && n.TryGetValue(out value))
                _requiresManualIntervention = bool.Parse(value);

            n = node.Element("dateAdded");
            if (n != null && n.TryGetValue(out value))
                _dateAdded = DateTime.Parse(value);

            n = node.Element("statisticsInfo");
            if (n != null)
                _statistics = new StatisticsInfo(n);

            n = node.Element("purchaseInfo");
            if (n != null)
                _purchase = new PurchaseInfo(n);

            n = node.Element("tags");
            if (n != null)
            {
                foreach (XElement e in n.Elements("tag"))
                {
                    string tag;
                    if (e.TryGetValue(out tag))
                        _tags.Add(tag);
                }
            }
        }