示例#1
0
 public void DeleteImage(EpubItem item)
 {
     System.Diagnostics.Trace.Assert(item.IsImage);
     Manifest.Remove(item);
     AbsolutePathIndex.Remove(item.AbsolutePath);
     IdIndex.Remove(item.Id);
 }
示例#2
0
 public void InsertChapter(List <EpubItem> chapters, EpubItem insertAt)
 {
     for (int i = 0; i < Manifest.Count; ++i)
     {
         if (insertAt == Manifest[i])
         {
             for (int j = 0; j < chapters.Count; ++j)
             {
                 Manifest.Insert(i + j, chapters[j]);
             }
             break;
         }
     }
     for (int i = 0; i < Spine.Count; ++i)
     {
         if (insertAt == Spine[i])
         {
             for (int j = 0; j < chapters.Count; ++j)
             {
                 Spine.Insert(i + j, chapters[j]);
             }
             break;
         }
     }
     for (int j = 0; j < chapters.Count; ++j)
     {
         var chapter = chapters[j];
         AbsolutePathIndex.Add(chapter.AbsolutePath, chapter);
         IdIndex.Add(chapter.Id, chapter);
     }
 }
示例#3
0
 public void RebuildIndexes()
 {
     AbsolutePathIndex.Clear();
     IdIndex.Clear();
     foreach (var item in Manifest)
     {
         AbsolutePathIndex.Add(item.AbsolutePath, item);
         IdIndex.Add(item.Id, item);
     }
 }
示例#4
0
 public void AppendItem(EpubItem item)
 {
     Manifest.Add(item);
     AbsolutePathIndex.Add(item.AbsolutePath, item);
     IdIndex.Add(item.Id, item);
 }