Inheritance: IChapterRecord
コード例 #1
0
ファイル: StorageDAL.cs プロジェクト: blacker-cz/MangaScraper
 private static DownloadedChapterInfo LoadDownloadInfoFromDataRow(DataRow row, ChapterRecord chapter)
 {
     return new DownloadedChapterInfo(chapter)
                {
                    Path = row["Path"] as string,
                    Downloaded = Convert.ToDateTime(row["Downloaded"]),
                    DownloadFolder = row["DownloadFolder"] as string,
                    DownloadFormatProviderId = (Guid) row["FormatProviderId"]
                };
 }
コード例 #2
0
ファイル: StorageDAL.cs プロジェクト: blacker-cz/MangaScraper
        private static ChapterRecord LoadChapterFromDataRow(DataRow row)
        {
            var mangaRecordKey = new Tuple<Guid, string>((Guid) row["ScraperId"], Convert.ToString(row["MangaId"]));
            var mangaRecord = MangaRecordsCache[mangaRecordKey];

            if (mangaRecord == null)
            {
                mangaRecord = new MangaRecord()
                                  {
                                      MangaId = Convert.ToString(row["MangaId"]),
                                      MangaName = Convert.ToString(row["MangaName"]),
                                      Scraper = (Guid) row["ScraperId"],
                                      Url = row["MangaUrl"] as string
                                  };

                MangaRecordsCache[mangaRecordKey] = mangaRecord;
            }

            var chapterRecord = new ChapterRecord()
                                    {
                                        ChapterId = Convert.ToString(row["ChapterId"]),
                                        ChapterName = Convert.ToString(row["ChapterName"]),
                                        Scraper = (Guid) row["ScraperId"],
                                        Url = Convert.ToString(row["ChapterUrl"]),
                                        MangaRecord = mangaRecord
                                    };

            return chapterRecord;
        }