/// <summary> /// Constructs a history entry of a particular type, populating /// its fields with the contents of a cartridge tag, and using /// <code>DateTime.Now</code> as timestamp. /// </summary> /// <param name="type"></param> /// <param name="cartTag"></param> public HistoryEntry(HistoryEntry.Type type, CartridgeTag cartTag) { EntryType = type; RelatedCartridgeFilename = cartTag.Cartridge.Filename; RelatedCartridgeGuid = cartTag.Guid; RelatedCartridgeName = cartTag.Title; BitmapSource thumb = (BitmapSource)cartTag.Icon; RelatedCartridgeThumbnailBase64 = thumb == null ? null : Utils.ImageUtils.ToBase64String(thumb, ThumbnailWidth, ThumbnailWidth); Timestamp = DateTime.Now; }
/// <summary> /// Removes all entries of a certain type, related to a cartridge GUID and a savegame name. /// </summary> /// <param name="cartridgeGuid"></param> /// <param name="savegameName"></param> /// <param name="entryType"></param> public void RemoveAllOf(string cartridgeGuid, string savegameName, HistoryEntry.Type entryType) { RemoveAllOf(he => he.EntryType == entryType && he.RelatedCartridgeGuid == cartridgeGuid && he.RelatedSavegameName == savegameName); }
/// <summary> /// Constructs a history entry of a particular type, populating /// its fields with the contents of a cartridge tag and a cartridge /// savegame, and using <code>DateTime.Now</code> as timestamp. /// </summary> /// <param name="type"></param> /// <param name="cartTag"></param> /// <param name="savegame"></param> public HistoryEntry(HistoryEntry.Type type, CartridgeTag cartTag, CartridgeSavegame savegame) : this(type, cartTag) { RelatedSavegameHashColor = savegame.HashColor; RelatedSavegameName = savegame.Name; }