From ae67581f326488d7d2e2057a5b13274bbcdd76ed Mon Sep 17 00:00:00 2001 From: F4lcon Date: Wed, 24 Oct 2018 23:21:18 +0200 Subject: [PATCH 1/2] Ignore .vs folder --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 789e4062..c9544b43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.vs/ + # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) bin obj From 2d20d14a8f1bfb99551cb8204d60754993a7ad1c Mon Sep 17 00:00:00 2001 From: F4lcon Date: Thu, 25 Oct 2018 00:03:31 +0200 Subject: [PATCH 2/2] Add a simple update system Use the AutoUpdater.NET package to implement a simple update system. It checks a xml file every time when the user opens the configuration app. --- Configuration/Configuration/App.xaml.cs | 17 +++++++++++ .../Configuration/Configuration.csproj | 21 ++++++++------ .../Properties/Settings.Designer.cs | 11 +++++++- .../Properties/Settings.settings | 12 ++++---- Configuration/Configuration/Settings.cs | 28 +++++++++++++++++++ Configuration/Configuration/app.config | 15 +++++++++- Configuration/Configuration/packages.config | 4 +++ 7 files changed, 93 insertions(+), 15 deletions(-) create mode 100644 Configuration/Configuration/Settings.cs create mode 100644 Configuration/Configuration/packages.config diff --git a/Configuration/Configuration/App.xaml.cs b/Configuration/Configuration/App.xaml.cs index bd61761f..2e11c89a 100644 --- a/Configuration/Configuration/App.xaml.cs +++ b/Configuration/Configuration/App.xaml.cs @@ -16,6 +16,8 @@ using System.Windows; using AlarmWorkflow.Shared.Diagnostics; using AlarmWorkflow.Shared.Diagnostics.Reports; +using AlarmWorkflow.Windows.Configuration.Properties; +using AutoUpdaterDotNET; namespace AlarmWorkflow.Windows.Configuration { @@ -39,6 +41,21 @@ public App() { Logger.Instance.Initialize(ComponentName); ErrorReportManager.RegisterAppDomainUnhandledExceptionListener(ComponentName); + + ConfigureAutoUpdate(); + } + + #endregion + + #region Methods + + private void ConfigureAutoUpdate() + { + AutoUpdater.OpenDownloadPage = true; + AutoUpdater.ReportErrors = false; + AutoUpdater.AppTitle = "AlarmWorkflow"; + + AutoUpdater.Start(Settings.Default.AutoUpdateURL); } #endregion diff --git a/Configuration/Configuration/Configuration.csproj b/Configuration/Configuration/Configuration.csproj index 404d0095..c5125e38 100644 --- a/Configuration/Configuration/Configuration.csproj +++ b/Configuration/Configuration/Configuration.csproj @@ -62,6 +62,9 @@ ..\..\Build\AlarmWorkflow.Windows.UIContracts.dll + + ..\packages\Autoupdater.NET.Official.1.4.11\lib\net40\AutoUpdater.NET.dll + @@ -85,7 +88,13 @@ Designer + + True + True + Settings.settings + + BooleanTypeEditor.xaml @@ -306,11 +315,6 @@ True Resources.resx - - True - Settings.settings - True - ResXFileCodeGenerator Resources.Designer.cs @@ -318,13 +322,14 @@ Designer - - Designer - + SettingsSingleFileGenerator Settings.Designer.cs + + Designer + diff --git a/Configuration/Configuration/Properties/Settings.Designer.cs b/Configuration/Configuration/Properties/Settings.Designer.cs index 3437ab20..140d2647 100644 --- a/Configuration/Configuration/Properties/Settings.Designer.cs +++ b/Configuration/Configuration/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace AlarmWorkflow.Windows.Configuration.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -22,5 +22,14 @@ public static Settings Default { return defaultInstance; } } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("https://www.openfiresource.de/release.xml")] + public string AutoUpdateURL { + get { + return ((string)(this["AutoUpdateURL"])); + } + } } } diff --git a/Configuration/Configuration/Properties/Settings.settings b/Configuration/Configuration/Properties/Settings.settings index 033d7a5e..43e3e85e 100644 --- a/Configuration/Configuration/Properties/Settings.settings +++ b/Configuration/Configuration/Properties/Settings.settings @@ -1,7 +1,9 @@  - - - - - + + + + + https://www.openfiresource.de/release.xml + + \ No newline at end of file diff --git a/Configuration/Configuration/Settings.cs b/Configuration/Configuration/Settings.cs new file mode 100644 index 00000000..1de8cde7 --- /dev/null +++ b/Configuration/Configuration/Settings.cs @@ -0,0 +1,28 @@ +namespace AlarmWorkflow.Windows.Configuration.Properties { + + + // This class allows you to handle specific events on the settings class: + // The SettingChanging event is raised before a setting's value is changed. + // The PropertyChanged event is raised after a setting's value is changed. + // The SettingsLoaded event is raised after the setting values are loaded. + // The SettingsSaving event is raised before the setting values are saved. + internal sealed partial class Settings { + + public Settings() { + // // To add event handlers for saving and changing settings, uncomment the lines below: + // + // this.SettingChanging += this.SettingChangingEventHandler; + // + // this.SettingsSaving += this.SettingsSavingEventHandler; + // + } + + private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { + // Add code to handle the SettingChangingEvent event here. + } + + private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { + // Add code to handle the SettingsSaving event here. + } + } +} diff --git a/Configuration/Configuration/app.config b/Configuration/Configuration/app.config index 8935d571..0e43feb3 100644 --- a/Configuration/Configuration/app.config +++ b/Configuration/Configuration/app.config @@ -1,3 +1,16 @@ - + + +
+ + + + + + + https://www.openfiresource.de/release.xml + + + + diff --git a/Configuration/Configuration/packages.config b/Configuration/Configuration/packages.config new file mode 100644 index 00000000..35c17c43 --- /dev/null +++ b/Configuration/Configuration/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file