public static void EncodeTap(string sourceXml, string destTap, string toVer) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(sourceXml); XmlTap tap = new XmlTap(); byte[] data = tap.Encode(xmlDoc, toVer); FileStream writer = new FileStream(destTap, FileMode.Create, FileAccess.Write); writer.Write(data, 0, data.Length); writer.Close(); }
public static void EncodeTap(string sourceXml, string destTap) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(sourceXml); string toVer = ""; XmlNode relVer = xmlDoc.SelectSingleNode("//ReleaseVersionNumber"); if (relVer != null) { if (relVer.InnerText.Equals("9")) toVer = "3.9"; else if (relVer.InnerText.Equals("10")) toVer = "3.10"; } XmlTap tap = new XmlTap(); byte[] data = tap.Encode(xmlDoc, toVer); FileStream writer = new FileStream(destTap, FileMode.Create, FileAccess.Write); writer.Write(data, 0, data.Length); writer.Close(); }
public static void ConvertVer(string source, string toVer) { XmlTap tap = new XmlTap(); XmlDocument xmlDoc = tap.DecodeTap(source); // edit if (toVer.Equals("3.9")) { VerTo39(ref xmlDoc); } else if (toVer.Equals("3.10")) { VerTo310(ref xmlDoc); } byte[] data = tap.Encode(xmlDoc, toVer); FileStream writer = new FileStream(source + ".tap" + toVer, FileMode.Create, FileAccess.Write); writer.Write(data, 0, data.Length); writer.Close(); xmlDoc = null; tap = null; }