public MangaArchiveCacheObject(MangaObject MangaObject, BookmarkObject BookmarkObject) : base() { SetValue(GuidPropertyKey, Guid.NewGuid()); this.MangaObject = MangaObject; this.BookmarkObject = BookmarkObject; if (!this.Empty() && !BookmarkObject.Equals(this.BookmarkObject, null)) { this.SetValue(IsNewPropertyKey, false); this.SetValue(ResumeChapterObjectPropertyKey, this.MangaObject.ChapterObjectOfBookmarkObject(this.BookmarkObject)); Int32 ResumeChapterObjectIndex = this.MangaObject.IndexOfChapterObject(this.ResumeChapterObject) + 1; this.SetValue(HasMoreToReadPropertyKey, ResumeChapterObjectIndex < this.MangaObject.Chapters.Count); this.SetValue(ChapterProgressMaximumPropertyKey, this.MangaObject.Chapters.Count); this.SetValue(ChapterProgressPropertyKey, ResumeChapterObjectIndex); } else if (!this.Empty()) { this.SetValue(IsNewPropertyKey, true); this.SetValue(HasMoreToReadPropertyKey, true); this.SetValue(ChapterProgressPropertyKey, 0); this.SetValue(ChapterProgressMaximumPropertyKey, 1); } this.LastUpdate = DateTime.Now; }
public MangaArchiveInformationObject(MangaObject MangaObject, BookmarkObject BookmarkObject) : base() { this.MangaObject = MangaObject; this.BookmarkObject = BookmarkObject; if(!this.Empty()) this.SetValue(ResumeChapterObjectPropertyKey, BookmarkObject.Equals(this.BookmarkObject, null) ? null : this.MangaObject.ChapterObjectOfBookmarkObject(this.BookmarkObject)); }
public MangaArchiveCacheObject(MangaObject MangaObject, BookmarkObject BookmarkObject) : base() { SetValue(GuidPropertyKey, Guid.NewGuid()); this.MangaObject = MangaObject; this.BookmarkObject = BookmarkObject; if (!this.Empty() && !BookmarkObject.Equals(this.BookmarkObject, null)) this.SetValue(ResumeChapterObjectPropertyKey, this.MangaObject.ChapterObjectOfBookmarkObject(this.BookmarkObject)); this.LastUpdate = DateTime.Now; }
public static PageObject PageObjectOfBookmarkObject(this ChapterObject value, BookmarkObject bookmark_object) { return value.Pages.Find(p => p.PageNumber == bookmark_object.Page); }
public static ChapterObject ChapterObjectOfBookmarkObject(this MangaObject value, BookmarkObject bookmark_object) { return value.Chapters.Find(c => c.Volume == bookmark_object.Volume && c.Chapter == bookmark_object.Chapter && c.SubChapter == bookmark_object.SubChapter); }