public Deserializer(BSA_File _bsaFile) { bsaFile = _bsaFile; bsaFile.SortEntries(); EntryCount = (bsaFile.BSA_Entries != null) ? int.Parse(bsaFile.BSA_Entries[bsaFile.BSA_Entries.Count() - 1].Index) + 1 : 0; Write(); }
public Deserializer(BSA_File _bsaFile, string location) { saveLocation = location; bsaFile = _bsaFile; bsaFile.SortEntries(); EntryCount = (bsaFile.BSA_Entries != null) ? int.Parse(bsaFile.BSA_Entries[bsaFile.BSA_Entries.Count() - 1].Index) + 1 : 0; Write(); File.WriteAllBytes(saveLocation, bytes.ToArray()); }
public Deserializer(string location) { saveLocation = String.Format("{0}/{1}", Path.GetDirectoryName(location), Path.GetFileNameWithoutExtension(location)); YAXSerializer serializer = new YAXSerializer(typeof(BSA_File), YAXSerializationOptions.DontSerializeNullObjects); bsaFile = (BSA_File)serializer.DeserializeFromFile(location); bsaFile.SortEntries(); EntryCount = (bsaFile.BSA_Entries != null) ? int.Parse(bsaFile.BSA_Entries[bsaFile.BSA_Entries.Count() - 1].Index) + 1 : 0; Write(); File.WriteAllBytes(saveLocation, bytes.ToArray()); }