Пример #1
0
 void LoadEventsFromFile(string filename)
 {
     if (File.Exists(filename))
     {
         using (SymBinaryReader reader = new SymBinaryReader(File.Open(filename, FileMode.Open)))
         {
             while (reader.PeekChar() != -1)
             {
                 GameEvent buf = new GameEvent();
                 buf.Read(reader);
                 Events.Add(buf);
             }
         }
     }
     else
         throw new IOException("File with events do not exist.");
 }