Ejemplo n.º 1
0
        public override void Parse(XmlDocument doc)
        {
            base.Parse(doc);

            if (Error == true)
            {
                return;
            }

            LoginValid   = doc.ReadBoolean("c2xml/login/valid");
            LoginMessage = doc.ReadString("c2xml/login/message");

            if (LoginValid == false)
            {
                return;
            }

            SessionID = doc.ReadString("c2xml/session/id");
            C2UserID  = doc.ReadString("c2xml/session/c2userid");
            FirstName = doc.ReadString("c2xml/session/firstname");
            LastName  = doc.ReadString("c2xml/session/lastname");

            List <SystemInfoShort> systems = new List <SystemInfoShort>();

            foreach (XmlNode item in doc.SelectNodes("c2xml/subscriptions/systemlist/system"))
            {
                var sysinfo = new SystemInfoShort();
                sysinfo.Parse(item);
                systems.Add(sysinfo);
            }

            Subscriptions = systems.ToArray();
        }
        public override void Parse(XmlDocument doc)
        {
            base.Parse(doc);

            List <SystemInfoShort> systems = new List <SystemInfoShort>();

            foreach (XmlNode item in doc.SelectNodes("subscriptions/systemlist/system"))
            {
                var sysinfo = new SystemInfoShort();
                sysinfo.Parse(item);
                systems.Add(sysinfo);
            }

            Subscriptions = systems.ToArray();
        }