Esempio n. 1
0
        private void OnXmlResultArrived(object sender, XmlResultArrivedEventArgs args)
        {
            XmlDocument doc         = new XmlDocument();
            string      read_string = "";

            doc.LoadXml(args.XmlResult);

            foreach (XmlNode node2 in doc.DocumentElement.ChildNodes)
            {
                if (node2.Name.Equals("general"))
                {
                    foreach (XmlNode node in node2.ChildNodes)
                    {
                        if (node.Name.Equals("full_string"))
                        {
                            read_string = node.InnerText;

                            foreach (XmlAttribute att in node.Attributes)
                            {
                                if (att.Name.Equals("encoding") && att.InnerText.Equals("base64") && !String.IsNullOrEmpty(node.InnerText))
                                {
                                    byte[] code = Convert.FromBase64String(node.InnerText);
                                    read_string = System.Text.Encoding.Default.GetString(code, 0, code.Length);
                                }
                            }

                            break;
                        }
                    }

                    // TODO: Process read string in read_string.
                }
            }
        }
        private void OnXmlResultArrived(object sender, XmlResultArrivedEventArgs args)
        {
            // If the current result info has the same result ID as the one we've just
            // received, store the xml result in it, otherwise create a new result info object.
            lock (_currentResultInfoSyncLock)
            {
                if (_resultCache.ContainsKey(args.ResultId))
                {
                    _resultCache[args.ResultId].XmlResult = args.XmlResult;
                }
                else
                {
                    _resultCache.Add(args.ResultId, new ResultInfo(args.ResultId, null, null, null, args.XmlResult));
                }

                ProcessResultQueue();
            }
        }
        private void OnXmlResultArrived(object sender, XmlResultArrivedEventArgs args)
        {
            XmlDocument doc = new XmlDocument();
            string read_string = "";

            doc.LoadXml(args.XmlResult);

            foreach (XmlNode node2 in doc.DocumentElement.ChildNodes)
            {
                if (node2.Name.Equals("general"))
                {
                    foreach (XmlNode node in node2.ChildNodes)
                    {
                        if (node.Name.Equals("full_string"))
                        {
                            read_string = node.InnerText;

                            foreach (XmlAttribute att in node.Attributes)
                            {
                                if (att.Name.Equals("encoding") && att.InnerText.Equals("base64") && !String.IsNullOrEmpty(node.InnerText))
                                {
                                    byte[] code = Convert.FromBase64String(node.InnerText);
                                    read_string = System.Text.Encoding.Default.GetString(code, 0, code.Length);
                                }
                            }

                            break;
                        }
                    }
                }
            }
        }