Пример #1
0
            public void ReadXml(XmlReader r)
            {
                while (r.MoveToNextAttribute())
                {
                    if (r.Name == "protocol")
                    {
                        protocol = r.Value;
                    }
                    else if (r.Name == "version")
                    {
                        version = r.Value;
                    }
                    else if (r.Name == "ismachine")
                    {
                        ismachine = r.Value;
                    }
                    else if (r.Name == "sessionid")
                    {
                        sessionid = r.Value;
                    }
                    else if (r.Name == "userid")
                    {
                        userid = r.Value;
                    }
                    else if (r.Name == "installsource")
                    {
                        installsource = r.Value;
                    }
                    else if (r.Name == "testsource")
                    {
                        testsource = r.Value;
                    }
                    else if (r.Name == "requestid")
                    {
                        requestid = r.Value;
                    }
                }
                while (r.Read())
                {
                    switch (r.NodeType)
                    {
                    case XmlNodeType.Element:
                        if (r.Name == "os")
                        {
                            XmlReader s = r.ReadSubtree();
                            s.Read();
                            os = new OSInfo();
                            os.ReadXml(s);
                            s.Close();
                        }
                        else if (r.Name == "app")
                        {
                            if (apps == null)
                            {
                                apps = new List <AppInfoRequest>();
                            }
                            XmlReader s = r.ReadSubtree();
                            s.Read();
                            AppInfoRequest ai_r = new AppInfoRequest();
                            ai_r.ReadXml(s);
                            s.Close();
                            apps.Add(ai_r);
                        }
                        break;
                    }
                }

                //r.Read();
                //r.ReadAttributeValue();
            }