Browse Source

其他-补充app首次启动标识,决定是否要显示注册弹窗

ZhouJieSheng 2 years ago
parent
commit
f634479ea1

+ 3 - 0
PDF Office/App.config

@@ -30,6 +30,9 @@
       <setting name="HeaderFooterIndex" serializeAs="String">
         <value>0</value>
       </setting>
+      <setting name="UpdateSettings" serializeAs="String">
+        <value>True</value>
+      </setting>
     </PDF_Office.Properties.Settings>
   </userSettings>
 </configuration>

+ 13 - 0
PDF Office/App.xaml.cs

@@ -85,6 +85,10 @@ namespace PDF_Office
         public static bool IsFirstOpen = true;
         public static bool IsBookMode = false;
 
+        //是否需要显示注册弹窗
+        //app第一次启动时需要弹出注册弹窗
+        public static bool IsShowRegist = false;
+
         public App()
         {
 #if !DEBUG
@@ -98,6 +102,15 @@ namespace PDF_Office
 
         private void InitSettings()
         {
+            if (Settings.Default.UpdateSettings)
+            {
+                Settings.Default.Upgrade();
+                Settings.Default.UpdateSettings = false;
+                App.IsShowRegist = true;
+                //重置用于弹窗的记录参数
+            }
+
+
             if (Settings.Default.RecentOpenFiles == null)
                 Settings.Default.RecentOpenFiles = new RecentOpenFiles();
 

+ 13 - 1
PDF Office/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace PDF_Office.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -213,5 +213,17 @@ namespace PDF_Office.Properties {
                 this["PresetFontList"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        public bool UpdateSettings {
+            get {
+                return ((bool)(this["UpdateSettings"]));
+            }
+            set {
+                this["UpdateSettings"] = value;
+            }
+        }
     }
 }

+ 3 - 0
PDF Office/Properties/Settings.settings

@@ -53,5 +53,8 @@
     <Setting Name="PresetFontList" Type="PDFSettings.PresetFontList" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
+    <Setting Name="UpdateSettings" Type="System.Boolean" Scope="User">
+      <Value Profile="(Default)">True</Value>
+    </Setting>
   </Settings>
 </SettingsFile>