Beispiel #1
0
 public Deserializer(BPE_File _bpeFile)
 {
     bpeFile = _bpeFile;
     bpeFile.SortEntries();
     EntryCount = (bpeFile.Entries != null) ? int.Parse(bpeFile.Entries[bpeFile.Entries.Count() - 1].Index) + 1 : 0;
     WriteBpe();
 }
Beispiel #2
0
 public Deserializer(BPE_File _bpeFile, string location)
 {
     saveLocation = location;
     bpeFile      = _bpeFile;
     bpeFile.SortEntries();
     EntryCount = (bpeFile.Entries != null) ? int.Parse(bpeFile.Entries[bpeFile.Entries.Count() - 1].Index) + 1 : 0;
     WriteBpe();
     File.WriteAllBytes(saveLocation, bytes.ToArray());
 }
Beispiel #3
0
        public Deserializer(string location)
        {
            saveLocation = String.Format("{0}/{1}", Path.GetDirectoryName(location), Path.GetFileNameWithoutExtension(location));
            YAXSerializer serializer = new YAXSerializer(typeof(BPE_File), YAXSerializationOptions.DontSerializeNullObjects);

            bpeFile = (BPE_File)serializer.DeserializeFromFile(location);
            bpeFile.SortEntries();
            EntryCount = (bpeFile.Entries != null) ? int.Parse(bpeFile.Entries[bpeFile.Entries.Count() - 1].Index) + 1 : 0;
            WriteBpe();
            File.WriteAllBytes(saveLocation, bytes.ToArray());
        }