|
@@ -226,6 +226,11 @@ namespace PDF_Master.ViewModels
|
|
|
|
|
|
#region 属性、变量
|
|
#region 属性、变量
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 用于退出页面编辑 设置bota搜索框
|
|
|
|
+ /// </summary>
|
|
|
|
+ private SearchContent searchContent = null;
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 显示 隐藏注释
|
|
/// 显示 隐藏注释
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -703,6 +708,7 @@ namespace PDF_Master.ViewModels
|
|
//关闭BOTA的逻辑在xaml.cs代码里控制,无法绑定后台
|
|
//关闭BOTA的逻辑在xaml.cs代码里控制,无法绑定后台
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 防止自动保存异步导致弹窗出现两次
|
|
/// 防止自动保存异步导致弹窗出现两次
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -1714,11 +1720,11 @@ namespace PDF_Master.ViewModels
|
|
|
|
|
|
private async void share()
|
|
private async void share()
|
|
{
|
|
{
|
|
- if (IsPopupInProgress)
|
|
|
|
|
|
+ if (IsPopupInProgress)
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- IsPopupInProgress=true;
|
|
|
|
|
|
+ IsPopupInProgress = true;
|
|
try
|
|
try
|
|
{
|
|
{
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_Share");
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_Share");
|
|
@@ -1956,7 +1962,7 @@ namespace PDF_Master.ViewModels
|
|
}
|
|
}
|
|
|
|
|
|
public void ShowPrintDialog()
|
|
public void ShowPrintDialog()
|
|
- {
|
|
|
|
|
|
+ {
|
|
//保存并继续,使用了高级功能则弹窗权益弹窗
|
|
//保存并继续,使用了高级功能则弹窗权益弹窗
|
|
if (!saveFile(true))
|
|
if (!saveFile(true))
|
|
{
|
|
{
|
|
@@ -2188,28 +2194,87 @@ namespace PDF_Master.ViewModels
|
|
var item = args.AddedItems[0] as TabItem;
|
|
var item = args.AddedItems[0] as TabItem;
|
|
CurrentBar = item.Name;
|
|
CurrentBar = item.Name;
|
|
TabControlSelectonDataTracking(item.Name);
|
|
TabControlSelectonDataTracking(item.Name);
|
|
|
|
+
|
|
if (previousBar != CurrentBar)
|
|
if (previousBar != CurrentBar)
|
|
{
|
|
{
|
|
if (CurrentBar == "TabItemPageEdit")//如果是页面编辑则进入页面编辑模式
|
|
if (CurrentBar == "TabItemPageEdit")//如果是页面编辑则进入页面编辑模式
|
|
{
|
|
{
|
|
EnterPageEdit();
|
|
EnterPageEdit();
|
|
|
|
+ searchContent = CleanSearch();
|
|
}
|
|
}
|
|
else//其余情况直接导航至对应的工具栏即可,不需要清空之前的content,region里是单例模式
|
|
else//其余情况直接导航至对应的工具栏即可,不需要清空之前的content,region里是单例模式
|
|
{
|
|
{
|
|
EnterSelectedBar(CurrentBar);
|
|
EnterSelectedBar(CurrentBar);
|
|
isInPageEdit = false;
|
|
isInPageEdit = false;
|
|
|
|
+ SearchTextFocus(searchContent);
|
|
}
|
|
}
|
|
previousBar = CurrentBar;
|
|
previousBar = CurrentBar;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void SearchTextFocus(SearchContent searchContent)
|
|
|
|
+ {
|
|
|
|
+ if (string.IsNullOrEmpty(searchContent.SearchText.Text) == false)
|
|
|
|
+ {
|
|
|
|
+ searchContent.SearchText.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
|
+ {
|
|
|
|
+ searchContent.SearchText.Focus();
|
|
|
|
+ searchContent.SearchText.SelectAll();
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private SearchContent CleanSearch()
|
|
|
|
+ {
|
|
|
|
+ SearchContent searchContent = null;
|
|
|
|
+ if (this.OpenBOTA)
|
|
|
|
+ {
|
|
|
|
+ bool isTabItemSearch = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemSearch");
|
|
|
|
+ if (bOTAContent.TabItemSearch.IsSelected)
|
|
|
|
+ {
|
|
|
|
+ SearchContentViewModel viewModel = GetSearchContentVM(bOTAContentViewModel, out searchContent);
|
|
|
|
+ if (viewModel.SearchItemList.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ PDFViewer.ClearPageSelectText();
|
|
|
|
+ viewModel.SearchItemList.Clear();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return searchContent;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private SearchContentViewModel GetSearchContentVM(BOTAContentViewModel bOTAContentViewModel, out SearchContent searchContent)
|
|
|
|
+ {
|
|
|
|
+ SearchContentViewModel viewModel = null;
|
|
|
|
+ searchContent = null;
|
|
|
|
+ if (bOTAContentViewModel != null)
|
|
|
|
+ {
|
|
|
|
+ if (region.Regions.ContainsRegionWithName(bOTAContentViewModel.BOTAContentRegionName))
|
|
|
|
+ {
|
|
|
|
+ var views = region.Regions[bOTAContentViewModel.BOTAContentRegionName].Views;
|
|
|
|
+ foreach (var item in views)
|
|
|
|
+ {
|
|
|
|
+ if (item is SearchContent search)
|
|
|
|
+ {
|
|
|
|
+ searchContent = search;
|
|
|
|
+ viewModel = search.DataContext as SearchContentViewModel;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return viewModel;
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 选项卡切换事件埋点
|
|
/// 选项卡切换事件埋点
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="e"></param>
|
|
/// <param name="e"></param>
|
|
private void TabControlSelectonDataTracking(string currentBar)
|
|
private void TabControlSelectonDataTracking(string currentBar)
|
|
{
|
|
{
|
|
- switch (currentBar) {
|
|
|
|
|
|
+ switch (currentBar)
|
|
|
|
+ {
|
|
case "TabItemAnnotation":
|
|
case "TabItemAnnotation":
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_Annotation");
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_Annotation");
|
|
break;
|
|
break;
|
|
@@ -2217,24 +2282,26 @@ namespace PDF_Master.ViewModels
|
|
case "TabItemEdit":
|
|
case "TabItemEdit":
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_EditPDF");
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_EditPDF");
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "TabItemPageEdit":
|
|
case "TabItemPageEdit":
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_PageEdit");
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_PageEdit");
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "TabItemConvert":
|
|
case "TabItemConvert":
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_Converter");
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_Converter");
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "TabItemTool":
|
|
case "TabItemTool":
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_Tools");
|
|
DataTrackingHelper.SendEvent(DataTrackingHelper.EventType.Tbr, "Tbr_Btn", "Btn_Tbr_Tools");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
|
- /// 进入页面编辑模式
|
|
|
|
- /// </summary>
|
|
|
|
- //工具栏添加功能应注意自处
|
|
|
|
- public void EnterPageEdit()
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 进入页面编辑模式
|
|
|
|
+ /// </summary>
|
|
|
|
+ //工具栏添加功能应注意自处
|
|
|
|
+ public void EnterPageEdit()
|
|
{
|
|
{
|
|
if (TabSelectedIndex != 2)
|
|
if (TabSelectedIndex != 2)
|
|
{
|
|
{
|
|
@@ -2602,6 +2669,7 @@ namespace PDF_Master.ViewModels
|
|
events.GetEvent<PageEditNotifyEvent>().Publish(new PageEditNotifyEventArgs(unicode));
|
|
events.GetEvent<PageEditNotifyEvent>().Publish(new PageEditNotifyEventArgs(unicode));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
private void Redo()
|
|
private void Redo()
|
|
{
|
|
{
|
|
PDFViewer.UndoManager.Redo();
|
|
PDFViewer.UndoManager.Redo();
|
|
@@ -2826,9 +2894,9 @@ namespace PDF_Master.ViewModels
|
|
//是否取消了水印保存步骤
|
|
//是否取消了水印保存步骤
|
|
bool flg = false;
|
|
bool flg = false;
|
|
//删掉Settings.Default.UserDate.isInFreeUseTime == false,没有试用期策略了
|
|
//删掉Settings.Default.UserDate.isInFreeUseTime == false,没有试用期策略了
|
|
- if ((!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1) && ((App.mainWindowViewModel.SelectedItem.DataContext as MainContentViewModel).IsUsedVIP == true||PDFViewer.UndoManager.PDFEditChanged==true))
|
|
|
|
|
|
+ if ((!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1) && ((App.mainWindowViewModel.SelectedItem.DataContext as MainContentViewModel).IsUsedVIP == true || PDFViewer.UndoManager.PDFEditChanged == true))
|
|
{
|
|
{
|
|
- DialogParameters value = new DialogParameters();
|
|
|
|
|
|
+ DialogParameters value = new DialogParameters();
|
|
value.Add(ParameterNames.ViewContentViewModel, this);
|
|
value.Add(ParameterNames.ViewContentViewModel, this);
|
|
if (autosave)
|
|
if (autosave)
|
|
{
|
|
{
|
|
@@ -3189,7 +3257,7 @@ namespace PDF_Master.ViewModels
|
|
DoAfterSaveAs(dlg.FileName);
|
|
DoAfterSaveAs(dlg.FileName);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
- { //提示文件被其他软件占用 无法保存
|
|
|
|
|
|
+ { //提示文件被其他软件占用 无法保存
|
|
AlertsMessage alertsMessage = new AlertsMessage();
|
|
AlertsMessage alertsMessage = new AlertsMessage();
|
|
alertsMessage.ShowDialog(App.MainPageLoader.GetString("Main_SaveFailed"), App.MainPageLoader.GetString("Main_TheFileOccupiedWarning"), App.ServiceLoader.GetString("Text_cancel"), App.ServiceLoader.GetString("Text_ok"));
|
|
alertsMessage.ShowDialog(App.MainPageLoader.GetString("Main_SaveFailed"), App.MainPageLoader.GetString("Main_TheFileOccupiedWarning"), App.ServiceLoader.GetString("Text_cancel"), App.ServiceLoader.GetString("Text_ok"));
|
|
}
|
|
}
|
|
@@ -3334,15 +3402,14 @@ namespace PDF_Master.ViewModels
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 转档、压缩、合并、分享前自动保存
|
|
/// 转档、压缩、合并、分享前自动保存
|
|
/// </summary>
|
|
/// </summary>
|
|
- public async Task<bool> SaveBeforeOption(bool NoIAP=false)
|
|
|
|
|
|
+ public async Task<bool> SaveBeforeOption(bool NoIAP = false)
|
|
{
|
|
{
|
|
- if(NoIAP == false)
|
|
|
|
|
|
+ if (NoIAP == false)
|
|
{ //添加付费拦截锁
|
|
{ //添加付费拦截锁
|
|
if (!ServiceHelper.IAPBeforeFunction())
|
|
if (!ServiceHelper.IAPBeforeFunction())
|
|
{
|
|
{
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
bool result = true;
|
|
bool result = true;
|
|
//因配合权益弹窗弹出,暂时移除可保存条件判断
|
|
//因配合权益弹窗弹出,暂时移除可保存条件判断
|
|
@@ -3391,7 +3458,7 @@ namespace PDF_Master.ViewModels
|
|
|
|
|
|
if (flg == false)
|
|
if (flg == false)
|
|
{
|
|
{
|
|
- return ;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var dlg = new SaveFileDialog();
|
|
var dlg = new SaveFileDialog();
|
|
@@ -3563,7 +3630,6 @@ namespace PDF_Master.ViewModels
|
|
|
|
|
|
private void EnterSelectedBar(string currentBar)
|
|
private void EnterSelectedBar(string currentBar)
|
|
{
|
|
{
|
|
-
|
|
|
|
NavigationParameters param = new NavigationParameters();
|
|
NavigationParameters param = new NavigationParameters();
|
|
param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
param.Add(ParameterNames.ViewContentViewModel, this);
|
|
param.Add(ParameterNames.ViewContentViewModel, this);
|
|
@@ -3596,6 +3662,7 @@ namespace PDF_Master.ViewModels
|
|
{
|
|
{
|
|
ServiceHelper.GetUser();
|
|
ServiceHelper.GetUser();
|
|
}
|
|
}
|
|
|
|
+
|
|
#endregion 方法
|
|
#endregion 方法
|
|
|
|
|
|
#region Navigate
|
|
#region Navigate
|