From b7fd2dad4ad262ee28b4db72a2c565fc43903483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20D=C3=A4schler?= Date: Tue, 9 Jul 2019 08:36:17 +0200 Subject: [PATCH] Added upgrade call for settings so that they are not lost after Outlook update --- .../Properties/Settings.Designer.cs | 22 ++++++++++++++----- .../Properties/Settings.settings | 3 +++ Outlook2013TodoAddIn/ThisAddIn.cs | 7 ++++++ Outlook2013TodoAddIn/app.config | 3 +++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Outlook2013TodoAddIn/Properties/Settings.Designer.cs b/Outlook2013TodoAddIn/Properties/Settings.Designer.cs index a12d51a..351bd5c 100644 --- a/Outlook2013TodoAddIn/Properties/Settings.Designer.cs +++ b/Outlook2013TodoAddIn/Properties/Settings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ namespace Outlook2013TodoAddIn.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -189,5 +189,17 @@ namespace Outlook2013TodoAddIn.Properties { this["ShowCompletedTasks"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool CallUpgrade { + get { + return ((bool)(this["CallUpgrade"])); + } + set { + this["CallUpgrade"] = value; + } + } } } diff --git a/Outlook2013TodoAddIn/Properties/Settings.settings b/Outlook2013TodoAddIn/Properties/Settings.settings index 188de82..837c4cb 100644 --- a/Outlook2013TodoAddIn/Properties/Settings.settings +++ b/Outlook2013TodoAddIn/Properties/Settings.settings @@ -44,5 +44,8 @@ False + + True + \ No newline at end of file diff --git a/Outlook2013TodoAddIn/ThisAddIn.cs b/Outlook2013TodoAddIn/ThisAddIn.cs index 4938fbc..6e416b9 100644 --- a/Outlook2013TodoAddIn/ThisAddIn.cs +++ b/Outlook2013TodoAddIn/ThisAddIn.cs @@ -38,6 +38,13 @@ namespace Outlook2013TodoAddIn { try { + + if (Properties.Settings.Default.CallUpgrade) + { + Properties.Settings.Default.Upgrade(); + Properties.Settings.Default.CallUpgrade = false; + } + Globals.ThisAddIn.Application.NewMailEx += Application_NewMailEx; this.AddRegistryNotification(); diff --git a/Outlook2013TodoAddIn/app.config b/Outlook2013TodoAddIn/app.config index a56c192..ebc42e5 100644 --- a/Outlook2013TodoAddIn/app.config +++ b/Outlook2013TodoAddIn/app.config @@ -46,6 +46,9 @@ False + + True +