|
@@ -275,7 +275,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
public DelegateCommand TimeAscendingCommand { get; set; }
|
|
public DelegateCommand TimeAscendingCommand { get; set; }
|
|
public DelegateCommand TimeDescendingCommand { get; set; }
|
|
public DelegateCommand TimeDescendingCommand { get; set; }
|
|
public string Unicode { get; private set; }
|
|
public string Unicode { get; private set; }
|
|
- private bool IsFirst = true;
|
|
|
|
|
|
+ private bool IsFirst = true;
|
|
|
|
+
|
|
public AnnotationContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
|
|
public AnnotationContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
|
|
{
|
|
{
|
|
region = regionManager;
|
|
region = regionManager;
|
|
@@ -312,8 +313,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
colors.Clear();
|
|
colors.Clear();
|
|
authors.Clear();
|
|
authors.Clear();
|
|
annotArgsTypes.Clear();
|
|
annotArgsTypes.Clear();
|
|
- AnnotationListItems.Clear();
|
|
|
|
-
|
|
|
|
|
|
+ AnnotationListItems.Clear();
|
|
|
|
+
|
|
CurrentAnnotationLists = GetDocumentAnnotionList(out HideAnnots);
|
|
CurrentAnnotationLists = GetDocumentAnnotionList(out HideAnnots);
|
|
AnnotationListItems.AddRange(CurrentAnnotationLists);
|
|
AnnotationListItems.AddRange(CurrentAnnotationLists);
|
|
Screen = Visibility.Collapsed;
|
|
Screen = Visibility.Collapsed;
|
|
@@ -326,8 +327,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
authors.Clear();
|
|
authors.Clear();
|
|
annotArgsTypes.Clear();
|
|
annotArgsTypes.Clear();
|
|
AnnotationListItems.Clear();
|
|
AnnotationListItems.Clear();
|
|
-
|
|
|
|
- //AnnotationListItems = GetDocumentAnnotionList(out ObservableCollection<AnnotationHandlerEventArgs> HideAnnots);
|
|
|
|
|
|
+
|
|
|
|
+ //AnnotationListItems = GetDocumentAnnotionList(out ObservableCollection<AnnotationHandlerEventArgs> HideAnnots);
|
|
CurrentAnnotationLists = GetDocumentAnnotionList(out HideAnnots);
|
|
CurrentAnnotationLists = GetDocumentAnnotionList(out HideAnnots);
|
|
AnnotationListItems.AddRange(CurrentAnnotationLists);
|
|
AnnotationListItems.AddRange(CurrentAnnotationLists);
|
|
RefreshAnnotationListItems();
|
|
RefreshAnnotationListItems();
|
|
@@ -711,8 +712,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
|
|
|
|
#endregion 类型 颜色 作者
|
|
#endregion 类型 颜色 作者
|
|
|
|
|
|
- #region 颜色 作者
|
|
|
|
-
|
|
|
|
|
|
+ #region 颜色 作者
|
|
|
|
+
|
|
else if (colors.Count > 0 && authors.Count > 0)
|
|
else if (colors.Count > 0 && authors.Count > 0)
|
|
{
|
|
{
|
|
foreach (var item in CurrentAnnotationLists)
|
|
foreach (var item in CurrentAnnotationLists)
|
|
@@ -732,8 +733,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
|
|
|
|
#endregion 颜色 作者
|
|
#endregion 颜色 作者
|
|
|
|
|
|
- #region 类型 作者
|
|
|
|
-
|
|
|
|
|
|
+ #region 类型 作者
|
|
|
|
+
|
|
else if (annotArgsTypes.Count > 0 && authors.Count > 0)
|
|
else if (annotArgsTypes.Count > 0 && authors.Count > 0)
|
|
{
|
|
{
|
|
foreach (var item in CurrentAnnotationLists)
|
|
foreach (var item in CurrentAnnotationLists)
|
|
@@ -753,8 +754,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
|
|
|
|
#endregion 类型 作者
|
|
#endregion 类型 作者
|
|
|
|
|
|
- #region 类型 颜色
|
|
|
|
-
|
|
|
|
|
|
+ #region 类型 颜色
|
|
|
|
+
|
|
else if (annotArgsTypes.Count > 0 && colors.Count > 0)
|
|
else if (annotArgsTypes.Count > 0 && colors.Count > 0)
|
|
{
|
|
{
|
|
foreach (var item in CurrentAnnotationLists)
|
|
foreach (var item in CurrentAnnotationLists)
|
|
@@ -774,8 +775,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
|
|
|
|
#endregion 类型 颜色
|
|
#endregion 类型 颜色
|
|
|
|
|
|
- #region 类型
|
|
|
|
-
|
|
|
|
|
|
+ #region 类型
|
|
|
|
+
|
|
else if (annotArgsTypes.Count > 0)
|
|
else if (annotArgsTypes.Count > 0)
|
|
{
|
|
{
|
|
foreach (var item in CurrentAnnotationLists)
|
|
foreach (var item in CurrentAnnotationLists)
|
|
@@ -792,8 +793,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
|
|
|
|
#endregion 类型
|
|
#endregion 类型
|
|
|
|
|
|
- #region 颜色
|
|
|
|
-
|
|
|
|
|
|
+ #region 颜色
|
|
|
|
+
|
|
else if (colors.Count > 0)
|
|
else if (colors.Count > 0)
|
|
{
|
|
{
|
|
foreach (var item in CurrentAnnotationLists)
|
|
foreach (var item in CurrentAnnotationLists)
|
|
@@ -807,8 +808,8 @@ namespace PDF_Master.ViewModels.BOTA
|
|
|
|
|
|
#endregion 颜色
|
|
#endregion 颜色
|
|
|
|
|
|
- #region 作者
|
|
|
|
-
|
|
|
|
|
|
+ #region 作者
|
|
|
|
+
|
|
else if (authors.Count > 0)
|
|
else if (authors.Count > 0)
|
|
{
|
|
{
|
|
foreach (var item in CurrentAnnotationLists)
|
|
foreach (var item in CurrentAnnotationLists)
|
|
@@ -945,12 +946,12 @@ namespace PDF_Master.ViewModels.BOTA
|
|
if (obj is ListBoxItem listBoxItem)
|
|
if (obj is ListBoxItem listBoxItem)
|
|
{
|
|
{
|
|
if (listBoxItem.DataContext is AnnotationHandlerEventArgs args)
|
|
if (listBoxItem.DataContext is AnnotationHandlerEventArgs args)
|
|
- {
|
|
|
|
- //if (args.EventType != AnnotArgsType.AnnotSticky && args.EventType != AnnotArgsType.AnnotFreeText && args.EventType != AnnotArgsType.AnnotLink)
|
|
|
|
- if (args.EventType != AnnotArgsType.AnnotSticky && args.EventType != AnnotArgsType.AnnotFreeText &&
|
|
|
|
- args.EventType != AnnotArgsType.AnnotHighlight && args.EventType != AnnotArgsType.AnnotUnderline
|
|
|
|
- && args.EventType != AnnotArgsType.AnnotStrikeout && args.EventType != AnnotArgsType.AnnotLink)
|
|
|
|
- {
|
|
|
|
|
|
+ {
|
|
|
|
+ //if (args.EventType != AnnotArgsType.AnnotSticky && args.EventType != AnnotArgsType.AnnotFreeText && args.EventType != AnnotArgsType.AnnotLink)
|
|
|
|
+ if (args.EventType != AnnotArgsType.AnnotSticky && args.EventType != AnnotArgsType.AnnotFreeText &&
|
|
|
|
+ args.EventType != AnnotArgsType.AnnotHighlight && args.EventType != AnnotArgsType.AnnotUnderline
|
|
|
|
+ && args.EventType != AnnotArgsType.AnnotStrikeout && args.EventType != AnnotArgsType.AnnotLink)
|
|
|
|
+ {
|
|
DialogParameters value = new DialogParameters();
|
|
DialogParameters value = new DialogParameters();
|
|
value.Add(ParameterNames.Annotation, args);
|
|
value.Add(ParameterNames.Annotation, args);
|
|
dialogs.ShowDialog(DialogNames.AddAnnotationDialog, value, e =>
|
|
dialogs.ShowDialog(DialogNames.AddAnnotationDialog, value, e =>
|
|
@@ -1026,11 +1027,14 @@ namespace PDF_Master.ViewModels.BOTA
|
|
{
|
|
{
|
|
//需要手动搜寻在哪一个分组 展开分组头
|
|
//需要手动搜寻在哪一个分组 展开分组头
|
|
ExpandGroupHeader(item, AnnotationList);
|
|
ExpandGroupHeader(item, AnnotationList);
|
|
- AnnotationList.SelectedItem = item;
|
|
|
|
|
|
+ if (AnnotationList.SelectedItems.IndexOf(item) == -1)
|
|
|
|
+ {
|
|
|
|
+ AnnotationList.SelectedItem = item;
|
|
|
|
+ }
|
|
|
|
+
|
|
await Task.Delay(1);
|
|
await Task.Delay(1);
|
|
AnnotationList.ScrollIntoView(item);
|
|
AnnotationList.ScrollIntoView(item);
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1090,13 +1094,12 @@ namespace PDF_Master.ViewModels.BOTA
|
|
}
|
|
}
|
|
ExpandGroupHeader(args, listBox);
|
|
ExpandGroupHeader(args, listBox);
|
|
// 关闭后选中关闭前的位置
|
|
// 关闭后选中关闭前的位置
|
|
- if (ViewContentViewModel.OpenBOTA) {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- await Task.Delay(5);//不加延时 会有不滚动的现象
|
|
|
|
-
|
|
|
|
- //events.GetEvent<ScrollIntoAnnotViewEvent>().Publish(new ScrollIntoAnnotViewArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, Annotation = item });
|
|
|
|
- listBox.ScrollIntoView(args);
|
|
|
|
|
|
+ if (ViewContentViewModel.OpenBOTA)
|
|
|
|
+ {
|
|
|
|
+ await Task.Delay(5);//不加延时 会有不滚动的现象
|
|
|
|
+
|
|
|
|
+ //events.GetEvent<ScrollIntoAnnotViewEvent>().Publish(new ScrollIntoAnnotViewArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, Annotation = item });
|
|
|
|
+ listBox.ScrollIntoView(args);
|
|
}
|
|
}
|
|
//if (!listBox.SelectedItems.Contains(args))
|
|
//if (!listBox.SelectedItems.Contains(args))
|
|
//{
|
|
//{
|
|
@@ -1211,14 +1214,14 @@ namespace PDF_Master.ViewModels.BOTA
|
|
await Task.Delay(5);//不加延时 每页的第一个注释不会展开
|
|
await Task.Delay(5);//不加延时 每页的第一个注释不会展开
|
|
if (ViewContentViewModel.IsMultiSelected == false)
|
|
if (ViewContentViewModel.IsMultiSelected == false)
|
|
{
|
|
{
|
|
- if (!listBox.SelectedItems.Contains(AnnotationListItems[k]))
|
|
|
|
|
|
+ if (listBox.SelectedItems.IndexOf(AnnotationListItems[k]) == -1)
|
|
|
|
+ //if (!listBox.SelectedItems.Contains(AnnotationListItems[k]))
|
|
{
|
|
{
|
|
listBox.SelectedItem = AnnotationListItems[k];
|
|
listBox.SelectedItem = AnnotationListItems[k];
|
|
//PdfViewer.SelectAnnotation(args.PageIndex, args.AnnotIndex);
|
|
//PdfViewer.SelectAnnotation(args.PageIndex, args.AnnotIndex);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
ExpandGroupHeader(AnnotationListItems[k], listBox);
|
|
ExpandGroupHeader(AnnotationListItems[k], listBox);
|
|
|
|
|
|
await Task.Delay(5);//不加延时 会有不滚动的现象
|
|
await Task.Delay(5);//不加延时 会有不滚动的现象
|
|
@@ -1311,7 +1314,7 @@ namespace PDF_Master.ViewModels.BOTA
|
|
iCollectionView.GroupDescriptions.Add(new PropertyGroupDescription(nameof(AnnotationHandlerEventArgs.PageIndex)));
|
|
iCollectionView.GroupDescriptions.Add(new PropertyGroupDescription(nameof(AnnotationHandlerEventArgs.PageIndex)));
|
|
iCollectionView.SortDescriptions.Add(new SortDescription(nameof(AnnotationHandlerEventArgs.PageIndex), ListSortDirection.Ascending));
|
|
iCollectionView.SortDescriptions.Add(new SortDescription(nameof(AnnotationHandlerEventArgs.PageIndex), ListSortDirection.Ascending));
|
|
iCollectionView.SortDescriptions.Add(new SortDescription(nameof(AnnotationHandlerEventArgs.AnnotIndex), ListSortDirection.Ascending));
|
|
iCollectionView.SortDescriptions.Add(new SortDescription(nameof(AnnotationHandlerEventArgs.AnnotIndex), ListSortDirection.Ascending));
|
|
-
|
|
|
|
|
|
+
|
|
//按照PageIndex,分组 排序
|
|
//按照PageIndex,分组 排序
|
|
SetGroupHeader(listBox);
|
|
SetGroupHeader(listBox);
|
|
Screen = Visibility.Collapsed;
|
|
Screen = Visibility.Collapsed;
|