/// <summary> /// Check all app in category and set 'installed' flag to real value /// </summary> public static void CheckAllInCategory( Category c ) { try { foreach (var app in c.Apps) app.Installed = CheckAppInstalled( app ); } catch (Exception ex) { Console.WriteLine(ex); //dev>>null } }
private static XElement SerializeCat( Category a ) { return new XElement( "category", new XAttribute( "name", a.Name ), a.Apps.Select( SerializeApp ) ); }
public Config( XmlNode n ) { Apps = n.ChildNodes.OfType<XmlNode>() .First( a => a.Name == "apps" ) .ChildNodes.OfType<XmlNode>() .Select( a => new Category( a ) ) .ToArray(); Support = new Category( n.ChildNodes.OfType<XmlNode>().First( a => a.Attributes != null && (a.Name == "category" && a.Attributes[ "name" ] != null && a.Attributes[ "name" ].Value == SnlName) ) ); Custom = new Category( n.ChildNodes.OfType<XmlNode>().First( a => a.Attributes != null && (a.Name == "category" && a.Attributes[ "name" ] != null && a.Attributes[ "name" ].Value == CustName) ) ); Lang = n.ChildNodes.OfType<XmlNode>().First( a => a.Name == "lang" ).InnerText; }