예제 #1
0
        static GetPricesAndStock.response SerializeResponseContent(Stream content)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(GetPricesAndStock.response));

            serializer.UnknownNode      += new XmlNodeEventHandler(serializer_UnknownNode);
            serializer.UnknownAttribute += new XmlAttributeEventHandler(serializer_UnknownAttribute);
            GetPricesAndStock.response Response = (GetPricesAndStock.response)serializer.Deserialize(content);
            return(Response);
        }
예제 #2
0
        static void PrintResults(GetPricesAndStock.response response)
        {
            if (response == null)
            {
                return;
            }
            foreach (var p in response.Data.ProductList)
            {
                Console.WriteLine(p.Symbol);
                Console.WriteLine();

                foreach (var price in p.PriceList)
                {
                    Console.WriteLine(price.Amount + "; " + price.PriceValue);
                }
                Console.WriteLine();
                Console.WriteLine(String.Format("W magazynie: {0}", p.Amount.ToString()));
                Console.WriteLine("\n");
            }
        }