コード例 #1
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 "name":
                    Name = node.InnerText;
                    break;

                case "key":
                    Key = XmlConvert.ToInt32(node.InnerText);
                    break;

                case "hacksets":
                    this.HackSets = new TFHackSet[node.ChildNodes.Count];
                    for (int x = 0; x < node.ChildNodes.Count; x++)
                    {
                        HackSets[x] = new TFHackSet();
                        HackSets[x].FromXML(node.ChildNodes[x].OuterXml);
                    }
                    break;
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Write an entire HackSet to the Process
 /// </summary>
 /// <param name="HackSet">HackSet to write</param>
 /// <returns>true if successful</returns>
 public bool WriteHackSet(TFHackSet HackSet)
 {
     return WriteHackValues(HackSet.HackValues);
 }
コード例 #3
0
ファイル: TFHack.cs プロジェクト: wccrawford/Game-Trainer
 public TFHack(String Name, int Key, TFHackSet[] HackSets)
 {
     this.Name = Name;
     this.Key = Key;
     this.HackSets = HackSets;
 }
コード例 #4
0
ファイル: TFHack.cs プロジェクト: wccrawford/Game-Trainer
 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 "name":
                 Name = node.InnerText;
                 break;
             case "key":
                 Key = XmlConvert.ToInt32(node.InnerText);
                 break;
             case "hacksets":
                 this.HackSets = new TFHackSet[node.ChildNodes.Count];
                 for (int x=0; x < node.ChildNodes.Count; x++)
                 {
                     HackSets[x] = new TFHackSet();
                     HackSets[x].FromXML(node.ChildNodes[x].OuterXml);
                 }
                 break;
         }
     }
 }
コード例 #5
0
 /// <summary>
 /// Write an entire HackSet to the Process
 /// </summary>
 /// <param name="HackSet">HackSet to write</param>
 /// <returns>true if successful</returns>
 public bool WriteHackSet(TFHackSet HackSet)
 {
     return(WriteHackValues(HackSet.HackValues));
 }