public override void SaveToAutoCat(AutoCat autocat) { AutoCatDevPub ac = autocat as AutoCatDevPub; if (ac == null) { return; } ac.Prefix = txtPrefix.Text; ac.OwnedOnly = chkOwnedOnly.Checked; ac.MinCount = (int)list_numScore.Value; ac.AllDevelopers = chkAllDevelopers.Checked; ac.AllPublishers = chkAllPublishers.Checked; ac.Developers.Clear(); if (!chkAllDevelopers.Checked) { foreach (ListViewItem item in clbDevelopersSelected.CheckedItems) { ac.Developers.Add(item.Tag.ToString()); } } ac.Publishers.Clear(); if (!chkAllPublishers.Checked) { foreach (ListViewItem item in clbPublishersSelected.CheckedItems) { ac.Publishers.Add(item.Tag.ToString()); } } }
public override void LoadFromAutoCat(AutoCat autocat) { AutoCatDevPub ac = autocat as AutoCatDevPub; if (ac == null) { return; } chkAllDevelopers.Checked = ac.AllDevelopers; chkAllPublishers.Checked = ac.AllPublishers; txtPrefix.Text = ac.Prefix; list_numScore.Value = ac.MinCount; chkOwnedOnly.Checked = ac.OwnedOnly; FillDevList(); FillPubList(); lstDevelopers.BeginUpdate(); foreach (ListViewItem item in lstDevelopers.Items) { item.Checked = ac.Developers.Contains(item.Tag.ToString()); } lstDevelopers.EndUpdate(); lstPublishers.BeginUpdate(); foreach (ListViewItem item in lstPublishers.Items) { item.Checked = ac.Publishers.Contains(item.Tag.ToString()); } lstPublishers.EndUpdate(); loaded = true; }
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); } }
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; }
public static AutoCat LoadACFromXmlElement(XmlElement xElement) { string type = xElement.Name; AutoCat result = null; switch (type) { case AutoCatGenre.TypeIdString: result = AutoCatGenre.LoadFromXmlElement(xElement); break; case AutoCatFlags.TypeIdString: result = AutoCatFlags.LoadFromXmlElement(xElement); break; case AutoCatTags.TypeIdString: result = AutoCatTags.LoadFromXmlElement(xElement); break; case AutoCatYear.TypeIdString: result = AutoCatYear.LoadFromXmlElement(xElement); break; case AutoCatUserScore.TypeIdString: result = AutoCatUserScore.LoadFromXmlElement(xElement); break; case AutoCatHltb.TypeIdString: result = AutoCatHltb.LoadFromXmlElement(xElement); break; case AutoCatManual.TypeIdString: result = AutoCatManual.LoadFromXmlElement(xElement); break; case AutoCatDevPub.TypeIdString: result = AutoCatDevPub.LoadFromXmlElement(xElement); break; case AutoCatGroup.TypeIdString: result = AutoCatGroup.LoadFromXmlElement(xElement); break; case AutoCatName.TypeIdString: result = AutoCatName.LoadFromXmlElement(xElement); break; default: break; } return(result); }
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; }
public static AutoCatDevPub LoadFromXmlElement(XmlElement xElement) { string name = XmlUtil.GetStringFromNode(xElement[XmlName_Name], TypeIdString); string filter = XmlUtil.GetStringFromNode(xElement[XmlName_Filter], null); bool AllDevelopers = XmlUtil.GetBoolFromNode(xElement[XmlName_AllDevelopers], false); bool AllPublishers = XmlUtil.GetBoolFromNode(xElement[XmlName_AllPublishers], false); string prefix = XmlUtil.GetStringFromNode(xElement[XmlName_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) { string s; if (XmlUtil.TryGetStringFromNode(node, out 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) { string s; if (XmlUtil.TryGetStringFromNode(node, out s)) { pubs.Add(s); } } } AutoCatDevPub result = new AutoCatDevPub(name, filter, prefix, owned, count, AllDevelopers, AllPublishers, devs, pubs); return(result); }
public static void GenerateDefaultAutoCatSet( List<AutoCat> list ) { //By Genre list.Add( new AutoCatGenre( GlobalStrings.Profile_DefaultAutoCatName_Genre, null, "("+ GlobalStrings.Name_Genre + ") " ) ); //By Year list.Add(new AutoCatYear(GlobalStrings.Profile_DefaultAutoCatName_Year, null, "(" + GlobalStrings.Name_Year + ") ")); //By Score AutoCatUserScore ac = new AutoCatUserScore(GlobalStrings.Profile_DefaultAutoCatName_UserScore, null, "(" + GlobalStrings.Name_Score + ") "); ac.GenerateSteamRules(ac.Rules); list.Add(ac); //By Tags AutoCatTags act = new AutoCatTags(GlobalStrings.Profile_DefaultAutoCatName_Tags, null, "(" + GlobalStrings.Name_Tags + ") "); foreach (Tuple<string, float> tag in Program.GameDB.CalculateSortedTagList(null, 1, 20, 0, false, false)) { act.IncludedTags.Add(tag.Item1); } list.Add(act); //By Flags AutoCatFlags acf = new AutoCatFlags(GlobalStrings.Profile_DefaultAutoCatName_Flags, null, "(" + GlobalStrings.Name_Flags + ") "); foreach (string flag in Program.GameDB.GetAllStoreFlags()) { acf.IncludedFlags.Add(flag); } list.Add(acf); //By Developer AutoCatDevPub acd = new AutoCatDevPub(GlobalStrings.Profile_DefaultAutoCatName_Developer, null, "(" + GlobalStrings.Name_Developer + ") "); acd.AllDevelopers = true; list.Add(acd); //By Publisher AutoCatDevPub acp = new AutoCatDevPub(GlobalStrings.Profile_DefaultAutoCatName_Publisher, null, "(" + GlobalStrings.Name_Publisher + ") "); acp.AllPublishers = true; list.Add(acp); //By HLTB AutoCatHltb ach = new AutoCatHltb(GlobalStrings.Profile_DefaultAutoCatName_Hltb, null, "(HLTB) ", false); ach.Rules.Add(new Hltb_Rule("0-5", 0, 5, TimeType.Extras)); ach.Rules.Add(new Hltb_Rule("5-10", 5, 10, TimeType.Extras)); ach.Rules.Add(new Hltb_Rule("10-20", 10, 20, TimeType.Extras)); ach.Rules.Add(new Hltb_Rule("20-50", 20, 50, TimeType.Extras)); ach.Rules.Add(new Hltb_Rule("50+", 20, 0, TimeType.Extras)); list.Add(ach); }
public static AutoCatDevPub LoadFromXmlElement(XmlElement xElement) { string name = XmlUtil.GetStringFromNode(xElement[XmlName_Name], TypeIdString); string filter = XmlUtil.GetStringFromNode(xElement[XmlName_Filter], null); bool AllDevelopers = XmlUtil.GetBoolFromNode(xElement[XmlName_AllDevelopers], false); bool AllPublishers = XmlUtil.GetBoolFromNode(xElement[XmlName_AllPublishers], false); string prefix = XmlUtil.GetStringFromNode(xElement[XmlName_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) { string s; if (XmlUtil.TryGetStringFromNode(node, out 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) { string s; if (XmlUtil.TryGetStringFromNode(node, out s)) { pubs.Add(s); } } } AutoCatDevPub result = new AutoCatDevPub(name, filter, prefix, owned, count, AllDevelopers, AllPublishers, devs, pubs); return result; }