public void Deserialize(BasicReader reader) { Id = reader.GetInt(); Title = reader.GetString(); Details = reader.GetString(); Time = new DateTime(reader.GetLong()); Color = ColorTranslator.FromWin32(reader.GetInt()); RepeatDaily = reader.GetBool(); }
private void LoadDb() { if (!File.Exists(_dbPath)) { SaveDb(); } using (BasicReader reader = new BasicReader(File.ReadAllBytes(_dbPath))) { var count = reader.GetInt(); for (var i = 0; i < count; i++) { var elem = reader.DeserializeObject <SchedulerElementData>(); _dataDict.Add(elem.Id, elem); CreateSchedulerElement(elem); } } }