// Store Kit wrapper to roar Unity client communication methods public void OnProductData(string productDataXml) { hasDataFromAppstore = true; productsList.Clear(); productsMap.Clear(); logger.DebugLog(string.Format("OnProductData() called with: {0}", productDataXml)); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(productDataXml); System.Xml.XmlNode appstoreNode = doc.FirstChild; if (!appstoreNode.HasChildNodes) { logger.DebugLog("No products passed to OnProductData()"); return; } foreach (System.Xml.XmlNode shopItemXml in appstoreNode) { if (shopItemXml.NodeType != System.Xml.XmlNodeType.Element) { continue; } AppstoreShopEntry product = AppstoreShopEntry.CreateFromXml(shopItemXml, ixcrm_parser); productsList.Add(product); productsMap.Add(product.product_identifier, product); } }
public static AppstoreShopEntry CreateFromXml(System.Xml.XmlNode n, Roar.DataConversion.IXCRMParser ixcrm_parser) { AppstoreShopEntry retval = new AppstoreShopEntry(); retval.product_identifier = n.Attributes["product_identifier"].Value; retval.label = n.Attributes["label"].Value; retval.modifiers = ixcrm_parser.ParseModifierList(n.SelectSingleNode("modifiers") as System.Xml.XmlElement); return(retval); }