Преглед на файлове

比较表-增加付费锁

ZhouJieSheng преди 2 години
родител
ревизия
886e8ad1c6

+ 6 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/CompressDialogs/CompressDialogViewModel.cs

@@ -197,7 +197,12 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
         }
         private void Compress()
         {
-
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
             /*
              *设置这个对话框的起始保存路径

+ 6 - 0
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -204,6 +204,12 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
 
         private void Merge()
         {
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             bool result = true;
             CPDFDocument SaveDoc = CPDFDocument.CreateDocument();
             for (int i = 0; i < MergeObjectlist.Count; i++)

+ 6 - 0
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/DeleteSafetySettingsDialogViewModel.cs

@@ -119,6 +119,12 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
         /// </summary>
         public void RemoveSecuritySettings()
         {
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
             /*
              *设置这个对话框的起始保存路径

+ 6 - 0
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogViewModel.cs

@@ -426,6 +426,12 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
 
         public void Encrypt()
         {
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             if (haveViewModel)
             {
                 viewContentViewModel.SecurityInfo.IsPasswordChanged = true;

+ 12 - 3
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -51,6 +51,7 @@ using Window = System.Windows.Window;
 using Task = System.Threading.Tasks.Task;
 using Size = System.Windows.Size;
 using System.Windows.Markup;
+using Prism.Services.Dialogs;
 
 namespace PDF_Office.ViewModels.FillAndSign
 {
@@ -99,11 +100,13 @@ namespace PDF_Office.ViewModels.FillAndSign
         /// 按钮名称和属性面板映射字典
         /// </summary>
         public Dictionary<string, string> btnToProperty = new Dictionary<string, string>();
+
+        private IDialogService dialogs;
         #endregion
 
-        public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events)
+        public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events,IDialogService dialogService)
         {
-           
+            dialogs = dialogService;
             regions = regionManager;
             this.events = events;
             CheckCommand = new DelegateCommand<RoutedEventArgs>(CheckedEvent);
@@ -367,6 +370,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         }
         private void CheckedEvent(RoutedEventArgs e)
         {
+
             IsEdit = false;
             var control = e.OriginalSource as Control;
 
@@ -376,7 +380,12 @@ namespace PDF_Office.ViewModels.FillAndSign
             bool isSnapshotEdit = false;
             AnnotHandlerEventArgs annotArgs = null;
 
-
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             var tag = control.Name;
             FindAnnotTypeKey(control.Name, ref annotArgs);
             if (control.Name == "RbtnSign") { isTemplateAnnot = true; }

+ 25 - 14
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -681,6 +681,7 @@ namespace PDF_Office.ViewModels.PageEdit
         /// </summary>
         private async void DeleteCommandEvent()
         {
+
             IsLoading = Visibility.Visible;
             await Task.Delay(3);
             DoRemoveSelectedPages();
@@ -1128,12 +1129,11 @@ namespace PDF_Office.ViewModels.PageEdit
         private void copy()
         {
             //付费锁
-            //if (!App.IsActive())
-            //{
-            //    IAPFunctionDialog dialog = new IAPFunctionDialog("PageEdit");
-            //    dialog.ShowDialog();
-            //    return;
-            //}
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             CacheFilePath.Instance.CopyDoc = null;
             CacheFilePath.Instance.CopyDoc = CPDFDocument.CreateDocument();
             List<int> pages = new List<int>();
@@ -1169,12 +1169,11 @@ namespace PDF_Office.ViewModels.PageEdit
         private async void paste()
         {
             //付费锁
-            //if (!App.IsActive())
-            //{
-            //    IAPFunctionDialog dialog = new IAPFunctionDialog("PageEdit");
-            //    dialog.ShowDialog();
-            //    return;
-            //}
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             IsLoading = Visibility.Visible;
             int insertindex = maxSelectedIndex > listSelecedIndex ? maxSelectedIndex : listSelecedIndex;
             insertindex++;
@@ -1426,8 +1425,13 @@ namespace PDF_Office.ViewModels.PageEdit
         /// </summary>
         private void DoRemoveSelectedPages(List<int> pageList = null, bool isFromUndoRedo = false)
         {
-      
-           List<int> indexList = new List<int>();
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
+            List<int> indexList = new List<int>();
             if (pageList == null || pageList.Count < 0)
             {
                 for (int i = 0; i < PageEditItems.Count; i++)
@@ -1947,6 +1951,13 @@ namespace PDF_Office.ViewModels.PageEdit
         /// <param name="rightRotate"></param>
         private async void RotateSelectedPages(bool rightRotate = true,List<int> pageitems=null,bool isFromUndoRedo = false)
         {
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
+
             IsLoading = Visibility.Visible;
             await Task.Delay(2);
             Dictionary<int, int> items = new Dictionary<int, int>();

+ 18 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -239,6 +239,12 @@ namespace PDF_Office.ViewModels.Tools
                     break;
 
                 case "Stamp"://图章
+                             //付费锁
+                    if (!App.IsLogin)
+                    {
+                        dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                        return;
+                    }
                     annotArgs = GetStamp();
                     break;
 
@@ -247,11 +253,23 @@ namespace PDF_Office.ViewModels.Tools
                     break;
 
                 case "Signature"://签名
+                                 //付费锁
+                    if (!App.IsLogin)
+                    {
+                        dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                        return;
+                    }
                     annotArgs = GetSignature();
                     PDFViewer.SetMouseMode(MouseModes.PanTool);//清空其他注释
                     break;
 
                 case "Link"://链接
+                            //付费锁
+                    if (!App.IsLogin)
+                    {
+                        dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                        return;
+                    }
                     propertyPanel.IsAddLink = true;
                     viewContentViewModel.IsRightMenuCreateLink = isRightMenuAdd;
                     annotArgs = GetLink();

+ 7 - 0
PDF Office/ViewModels/Tools/ConverterBarContentViewModel.cs

@@ -64,6 +64,13 @@ namespace PDF_Office.ViewModels.Tools
 
         private void toconverter(object sender)
         {
+            //付费锁
+            if(!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
+
             var args = sender as Button;
             if (args != null)
             {

+ 12 - 0
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -279,6 +279,12 @@ namespace PDF_Office.ViewModels.Tools
 
         private async Task WaitCropCurrentPageWM()
         {
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             await Task.Run(() =>
             {
                 if (PDFViewer.CurrentIndex > 0)
@@ -295,6 +301,12 @@ namespace PDF_Office.ViewModels.Tools
 
         private async Task WaitCropAllPagesWM()
         {
+            //付费锁
+            if (!App.IsLogin)
+            {
+                dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+                return;
+            }
             await Task.Run(() =>
             {
                 List<int> cropPagesList = new List<int>();

Файловите разлики са ограничени, защото са твърде много
+ 174 - 56
PDF Office/Views/Tools/ConverterBarContent.xaml


Файловите разлики са ограничени, защото са твърде много
+ 120 - 93
PDF Office/Views/Tools/ToolsBarContent.xaml