Browse Source

偏好设置-未付费用户,不进行自动保存

ZhouJieSheng 1 year ago
parent
commit
8bf8b0e407

+ 18 - 1
PDF Office/ViewModels/Dialog/SettingsDialogViewModel.cs

@@ -853,6 +853,19 @@ namespace PDF_Master.ViewModels.Dialog
         }
 
 
+        private bool autoSaveEnable = true;
+
+        /// <summary>
+        /// 是否允许设置自动保存
+        /// 未付费用户 不进行自动保存
+        /// </summary>
+        public bool AutoSaveEnable
+        {
+            get { return autoSaveEnable; }
+            set { autoSaveEnable = value; }
+        }
+
+
         public SettingsDialogViewModel()
         {
             InitString();
@@ -876,7 +889,11 @@ namespace PDF_Master.ViewModels.Dialog
             //判断是否以管理员身份运行
             IsSetDefualtAppEnable = Win32Helper.IsRunAsAdmin();
             IsDefualtApp = Win32Helper.IsDefaultApp();
-            
+            //未付费用户不进行自动保存
+            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
+            {
+                AutoSaveEnable = false;
+            }
         }
 
         private void InitView()

+ 7 - 0
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -1171,7 +1171,14 @@ namespace PDF_Master.ViewModels
 
         private void AutoSaveTimer_Tick(object sender, EventArgs e)
         {
+            //未付费的用户不进行自动保存
+            if (!App.IsLogin || Settings.Default.UserDate.subscribestatus != 1)
+            {
+                return;
+            }
+
             var autoSave = Settings.Default.AppProperties.Description.AutoSave;
+
             if (autoSave && !mainViewModel.NewFile && PDFViewer.UndoManager.CanSave)
             {
                 //自动保存仅针对已经有文件路径的文档

+ 21 - 14
PDF Office/Views/Dialog/SettingsDialog.xaml

@@ -169,6 +169,7 @@
                                         BorderThickness="0"
                                         FontSize="14"
                                         Foreground="{StaticResource color.field.text.act}"
+                                        IsEnabled="{Binding AutoSaveEnable}"
                                         Maximum="50"
                                         Minimum="10"
                                         Value="{Binding Descript.FileCountInRecentFiles, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
@@ -386,12 +387,18 @@
                         <Label Content="{Binding Settings_Display_Background}" Style="{StaticResource Label}" />
                         <WrapPanel Margin="0,8,0,16">
                             <Label Content="{Binding Settings_Display_Normal}" Style="{StaticResource Label2}" />
-                            <compositecontrol:ColorContent SelectedColor="{Binding View.BackGround, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ShowColorList="Collapsed" IsColorDropPickerClick="False"/>
+                            <compositecontrol:ColorContent
+                                IsColorDropPickerClick="False"
+                                SelectedColor="{Binding View.BackGround, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                ShowColorList="Collapsed" />
                             <Label
                                 Margin="16,0,0,0"
                                 Content="{Binding Settings_Display_Full}"
                                 Style="{StaticResource Label}" />
-                            <compositecontrol:ColorContent SelectedColor="{Binding View.BackGroundInFulWindow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ShowColorList="Collapsed" IsColorDropPickerClick="False"/>
+                            <compositecontrol:ColorContent
+                                IsColorDropPickerClick="False"
+                                SelectedColor="{Binding View.BackGroundInFulWindow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                ShowColorList="Collapsed" />
                         </WrapPanel>
                         <!--<CheckBox
                             Margin="5,0,0,8"
@@ -458,8 +465,8 @@
                                     Grid.Column="1"
                                     Height="40"
                                     HorizontalAlignment="Left"
-                                    SelectedColor="{Binding Annote.HighLightColor, Mode=TwoWay}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.HighLightColor, Mode=TwoWay}"
                                     ShowColorList="Collapsed" />
 
                                 <Label
@@ -469,8 +476,8 @@
                                 <compositecontrol:ColorContent
                                     Grid.Column="3"
                                     Height="40"
-                                    SelectedColor="{Binding Annote.RectangleFillColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.RectangleFillColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="1"
@@ -481,8 +488,8 @@
                                     Grid.Column="1"
                                     Height="40"
                                     HorizontalAlignment="Left"
-                                    SelectedColor="{Binding Annote.StrikethroughColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.StrikethroughColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="1"
@@ -493,8 +500,8 @@
                                     Grid.Row="1"
                                     Grid.Column="3"
                                     Height="40"
-                                    SelectedColor="{Binding Annote.RectangleBorderColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.RectangleBorderColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="2"
@@ -505,8 +512,8 @@
                                     Grid.Column="1"
                                     Height="40"
                                     HorizontalAlignment="Left"
-                                    SelectedColor="{Binding Annote.UnderLineColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.UnderLineColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="2"
@@ -517,8 +524,8 @@
                                     Grid.Row="2"
                                     Grid.Column="3"
                                     Height="40"
-                                    SelectedColor="{Binding Annote.CircleFillColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.CircleFillColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="3"
@@ -529,8 +536,8 @@
                                     Grid.Column="1"
                                     Height="40"
                                     HorizontalAlignment="Left"
-                                    SelectedColor="{Binding Annote.FreeHandColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.FreeHandColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="3"
@@ -541,8 +548,8 @@
                                     Grid.Row="3"
                                     Grid.Column="3"
                                     Height="40"
-                                    SelectedColor="{Binding Annote.CircleBorderColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.CircleBorderColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="4"
@@ -553,8 +560,8 @@
                                     Grid.Column="1"
                                     Height="40"
                                     HorizontalAlignment="Left"
-                                    SelectedColor="{Binding Annote.TextAnnoteColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.TextAnnoteColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="4"
@@ -565,8 +572,8 @@
                                     Grid.Row="4"
                                     Grid.Column="3"
                                     Height="40"
-                                    SelectedColor="{Binding Annote.LineColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.LineColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="5"
@@ -577,8 +584,8 @@
                                     Grid.Column="1"
                                     Height="40"
                                     HorizontalAlignment="Left"
-                                    SelectedColor="{Binding Annote.NoteAnnoteColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.NoteAnnoteColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="5"
@@ -590,8 +597,8 @@
                                     Grid.Column="4"
                                     Height="40"
                                     HorizontalAlignment="Left"
-                                    SelectedColor="{Binding Annote.ArrowColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     IsColorDropPickerClick="False"
+                                    SelectedColor="{Binding Annote.ArrowColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                             </Grid>
                         </Border>