|
@@ -888,22 +888,29 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
|
|
|
private void DelBookMark_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
-
|
|
|
CheckBOTAState(out BOTAContentViewModel bOTAContentVM, out BOTAContent bOTA);
|
|
|
- if (bOTAContentVM != null && bOTA != null)
|
|
|
- {
|
|
|
- BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentVM, out BookmarkContent bookmark);
|
|
|
-
|
|
|
- int index = PDFViewer.CurrentIndex;
|
|
|
- //检测是否已存在相同数据
|
|
|
- if (PDFViewer.Document == null) return;
|
|
|
- if (PDFViewer.Document.GetBookmarkList().Count <= 0) return;
|
|
|
- CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
|
|
|
- if (bookmarkContentViewModel != null && bookmark != null && bOTA != null && list != null)
|
|
|
- {
|
|
|
- bookmarkContentViewModel.DeleteCommand.Execute(list);
|
|
|
- isAddBookMark = bookmarkContentViewModel.isAddBookMark;
|
|
|
+ if (viewContentViewModel.mainViewModel.IsBookMode == false)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (bOTAContentVM != null && bOTA != null)
|
|
|
+ {
|
|
|
+ BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentVM, out BookmarkContent bookmark);
|
|
|
+
|
|
|
+ int index = PDFViewer.CurrentIndex;
|
|
|
+ //检测是否已存在相同数据
|
|
|
+ if (PDFViewer.Document == null) return;
|
|
|
+ if (PDFViewer.Document.GetBookmarkList().Count <= 0) return;
|
|
|
+ CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
|
|
|
+ if (bookmarkContentViewModel != null && bookmark != null && bOTA != null && list != null)
|
|
|
+ {
|
|
|
+ bookmarkContentViewModel.DeleteCommand.Execute(list);
|
|
|
+ isAddBookMark = bookmarkContentViewModel.isAddBookMark;
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ this.events.GetEvent<DelBookMarkEvent>().Publish(new BookMarkArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, IsReadMode = true });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -915,30 +922,34 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
}
|
|
|
bool isBook = IsBOTATabItemShow(out bOTAContentVM, out bOTA, "TabItemBookMark");
|
|
|
if (isBook == false)
|
|
|
- {
|
|
|
- if (viewContentViewModel.mainViewModel.IsBookMode==false)
|
|
|
- {
|
|
|
- bOTA.TabItemBookMark.IsSelected = true;
|
|
|
- }
|
|
|
-
|
|
|
+ {
|
|
|
+ bOTA.TabItemBookMark.IsSelected = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void AddBookMark_Click()
|
|
|
{
|
|
|
CheckBOTAState(out BOTAContentViewModel bOTAContentVM, out BOTAContent bOTA);
|
|
|
- //if (viewContentViewModel.mainViewModel.IsBookMode)
|
|
|
- //{
|
|
|
- // this.events.GetEvent<ReadModeBOTAShowEvent>().Publish(new ReadModeBOTAShowArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, IsBOTAShow = true });
|
|
|
- //}
|
|
|
- if (bOTAContentVM != null && bOTA != null)
|
|
|
- {
|
|
|
- AddBookMark(bOTAContentVM, bOTA);
|
|
|
- }
|
|
|
- //if (viewContentViewModel.mainViewModel.IsBookMode)
|
|
|
- //{
|
|
|
- // AddBookMark(bOTAContentVM, bOTA);
|
|
|
- //}
|
|
|
+ if (viewContentViewModel.mainViewModel.IsBookMode == false)
|
|
|
+ {
|
|
|
+
|
|
|
+ //if (viewContentViewModel.mainViewModel.IsBookMode)
|
|
|
+ //{
|
|
|
+ // this.events.GetEvent<ReadModeBOTAShowEvent>().Publish(new ReadModeBOTAShowArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, IsBOTAShow = true });
|
|
|
+ //}
|
|
|
+ if (bOTAContentVM != null && bOTA != null)
|
|
|
+ {
|
|
|
+ AddBookMark(bOTAContentVM, bOTA);
|
|
|
+ }
|
|
|
+ //if (viewContentViewModel.mainViewModel.IsBookMode)
|
|
|
+ //{
|
|
|
+ // AddBookMark(bOTAContentVM, bOTA);
|
|
|
+ //}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ this.events.GetEvent<AddBookMarkEvent>().Publish(new BookMarkArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, IsReadMode = true });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void AddBookMark(BOTAContentViewModel bOTAContentVM, BOTAContent bOTA)
|