Added upgrade call for settings so that they are not lost after Outlook update

This commit is contained in:
Markus Däschler 2019-07-09 08:36:17 +02:00
parent 3f1d5f3570
commit b7fd2dad4a
4 changed files with 30 additions and 5 deletions

View File

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
@ -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;
}
}
}
}

View File

@ -44,5 +44,8 @@
<Setting Name="ShowCompletedTasks" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="CallUpgrade" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -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();

View File

@ -46,6 +46,9 @@
<setting name="ShowCompletedTasks" serializeAs="String">
<value>False</value>
</setting>
<setting name="CallUpgrade" serializeAs="String">
<value>True</value>
</setting>
</Outlook2013TodoAddIn.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>