Exemple #1
0
        public static AutoCat LoadACFromXmlElement(XmlElement xElement)
        {
            string type = xElement.Name;

            switch (type)
            {
            case AutoCatGenre.TypeIdString:
                return(AutoCatGenre.LoadFromXmlElement(xElement));

            case AutoCatFlags.TypeIdString:
                return(AutoCatFlags.LoadFromXmlElement(xElement));

            case AutoCatTags.TypeIdString:
                return(AutoCatTags.LoadFromXmlElement(xElement));

            case AutoCatYear.TypeIdString:
                return(AutoCatYear.LoadFromXmlElement(xElement));

            case AutoCatUserScore.TypeIdString:
                return(AutoCatUserScore.LoadFromXmlElement(xElement));

            case AutoCatHltb.TypeIdString:
                return(AutoCatHltb.LoadFromXmlElement(xElement));

            case AutoCatManual.TypeIdString:
                return(AutoCatManual.LoadFromXmlElement(xElement));

            case AutoCatDevPub.TypeIdString:
                return(AutoCatDevPub.LoadFromXmlElement(xElement));

            case AutoCatGroup.TypeIdString:
                return(AutoCatGroup.LoadFromXmlElement(xElement));

            case AutoCatName.TypeIdString:
                return(AutoCatName.LoadFromXmlElement(xElement));

            case AutoCatVrSupport.TypeIdString:
                return(AutoCatVrSupport.LoadFromXmlElement(xElement));

            case AutoCatLanguage.TypeIdString:
                return(AutoCatLanguage.LoadFromXmlElement(xElement));

            case AutoCatCurator.TypeIdString:
                return(LoadFromXmlElement(xElement, typeof(AutoCatCurator)));

            case AutoCatPlatform.TypeIdString:
                return(LoadFromXmlElement(xElement, typeof(AutoCatPlatform)));

            case AutoCatHoursPlayed.TypeIdString:
                return(AutoCatHoursPlayed.LoadFromXmlElement(xElement));

            default:
                return(null);
            }
        }
Exemple #2
0
 protected AutoCatDevPub(AutoCatDevPub other) : base(other)
 {
     Filter        = other.Filter;
     Prefix        = other.Prefix;
     OwnedOnly     = other.OwnedOnly;
     MinCount      = other.MinCount;
     AllDevelopers = other.AllDevelopers;
     AllPublishers = other.AllPublishers;
     Developers    = new List <string>(other.Developers);
     Publishers    = new List <string>(other.Publishers);
     Selected      = other.Selected;
 }
Exemple #3
0
        public static AutoCatDevPub LoadFromXmlElement(XmlElement xElement)
        {
            string name          = XmlUtil.GetStringFromNode(xElement[Serialization.Constants.Name], TypeIdString);
            string filter        = XmlUtil.GetStringFromNode(xElement[Serialization.Constants.Filter], null);
            bool   AllDevelopers = XmlUtil.GetBoolFromNode(xElement[XmlName_AllDevelopers], false);
            bool   AllPublishers = XmlUtil.GetBoolFromNode(xElement[XmlName_AllPublishers], false);
            string prefix        = XmlUtil.GetStringFromNode(xElement[Serialization.Constants.Prefix], null);
            bool   owned         = XmlUtil.GetBoolFromNode(xElement[XmlName_OwnedOnly], false);
            int    count         = XmlUtil.GetIntFromNode(xElement[XmlName_MinCount], 0);

            List <string> devs = new List <string>();

            XmlElement devsListElement = xElement[XmlName_Developers];

            if (devsListElement != null)
            {
                XmlNodeList devNodes = devsListElement.SelectNodes(XmlName_Developer);
                foreach (XmlNode node in devNodes)
                {
                    if (XmlUtil.TryGetStringFromNode(node, out string s))
                    {
                        devs.Add(s);
                    }
                }
            }

            List <string> pubs = new List <string>();

            XmlElement pubsListElement = xElement[XmlName_Publishers];

            if (pubsListElement != null)
            {
                XmlNodeList pubNodes = pubsListElement.SelectNodes(XmlName_Publisher);
                foreach (XmlNode node in pubNodes)
                {
                    if (XmlUtil.TryGetStringFromNode(node, out string s))
                    {
                        pubs.Add(s);
                    }
                }
            }

            AutoCatDevPub result = new AutoCatDevPub(name, filter, prefix, owned, count, AllDevelopers, AllPublishers, devs, pubs);

            return(result);
        }