Ejemplo n.º 1
0
 public TFHackInfo(String GameName, String ProcessName, TFHack[] Hacks, int MajorVersion, int MinorVersion)
 {
     this.GameName = GameName;
     this.ProcessName = ProcessName;
     this.Hacks = Hacks;
     this.MajorVersion = MajorVersion;
     this.MinorVersion = MinorVersion;
 }
Ejemplo n.º 2
0
        public void FromXML(String XML)
        {
            XmlDocument XMLdoc = new XmlDocument();

            XMLdoc.LoadXml(XML);
            XmlNode XMLnode = XMLdoc.DocumentElement;

            foreach (XmlNode node in XMLnode.ChildNodes)
            {
                switch (node.Name)
                {
                case "gamename":
                    GameName = node.InnerText;
                    break;

                case "processname":
                    ProcessName = node.InnerText;
                    break;

                case "version":
                    String[] version = node.InnerText.Split('.');
                    MajorVersion = Convert.ToInt32(version[0]);
                    MinorVersion = Convert.ToInt32(version[1]);
                    break;

                case "hacks":
                    this.Hacks = new TFHack[node.ChildNodes.Count];
                    for (int x = 0; x < node.ChildNodes.Count; x++)
                    {
                        Hacks[x] = new TFHack();
                        Hacks[x].FromXML(node.ChildNodes[x].OuterXml);
                    }
                    break;
                }
            }
        }
Ejemplo n.º 3
0
 public void FromXML(String XML)
 {
     XmlDocument XMLdoc = new XmlDocument();
     XMLdoc.LoadXml(XML);
     XmlNode XMLnode = XMLdoc.DocumentElement;
     foreach (XmlNode node in XMLnode.ChildNodes)
     {
         switch(node.Name)
         {
             case "gamename":
                 GameName = node.InnerText;
                 break;
             case "processname":
                 ProcessName = node.InnerText;
                 break;
             case "version":
                 String[] version = node.InnerText.Split('.');
                 MajorVersion = Convert.ToInt32(version[0]);
                 MinorVersion = Convert.ToInt32(version[1]);
                 break;
             case "hacks":
                 this.Hacks = new TFHack[node.ChildNodes.Count];
                 for (int x=0; x < node.ChildNodes.Count; x++)
                 {
                     Hacks[x] = new TFHack();
                     Hacks[x].FromXML(node.ChildNodes[x].OuterXml);
                 }
                 break;
         }
     }
 }