public Repacker(string fileLocation, EmbIndex embIndex) { directoryLocation = fileLocation; saveLocation = String.Format("{0}/{1}.emb", Path.GetDirectoryName(fileLocation), Path.GetFileName(fileLocation)); EmbIndexXml = embIndex; WriteBinaryEmb(); }
bool ReadXmlFile() { if (!File.Exists(directoryLocation + "/EmbIndex.xml")) { Console.WriteLine("Could not find \"EmbIndex.xml\"\n" + "Extraction failed."); Console.ReadLine(); return(false); } try { YAXSerializer serializer = new YAXSerializer(typeof(EmbIndex)); EmbIndexXml = (EmbIndex)serializer.DeserializeFromFile(directoryLocation + "/EmbIndex.xml"); return(true); } catch { Console.WriteLine("Could not read \"EmbIndex.xml\". It is corrupted!\n" + "Extraction failed."); Console.ReadLine(); return(false); } }