diff --git a/src/SampleApp.WinDesktop/App.config b/src/SampleApp.WinDesktop/App.config index bae5d6d..3dca91d 100644 --- a/src/SampleApp.WinDesktop/App.config +++ b/src/SampleApp.WinDesktop/App.config @@ -1,6 +1,27 @@ + + +
+ + + + + + esricaster.esri.com + + + 2101 + + + + + + + + + diff --git a/src/SampleApp.WinDesktop/NtripView.xaml.cs b/src/SampleApp.WinDesktop/NtripView.xaml.cs index d955e04..50b5eef 100644 --- a/src/SampleApp.WinDesktop/NtripView.xaml.cs +++ b/src/SampleApp.WinDesktop/NtripView.xaml.cs @@ -27,6 +27,10 @@ namespace SampleApp.WinDesktop public NtripView() { InitializeComponent(); + host.Text = UserSettings.Default.NTRIPServer; + port.Text = UserSettings.Default.NTRIPPort.ToString(); + username.Text = UserSettings.Default.NTRIPUsername; + password.Password = UserSettings.Default.NTRIPPassword; } NmeaParser.Gnss.Ntrip.Client client; private void Button_Click(object sender, RoutedEventArgs e) @@ -53,6 +57,12 @@ namespace SampleApp.WinDesktop MessageBox.Show("Failed to connect: " + ex.Message); return; } + + UserSettings.Default.NTRIPServer = host.Text; + UserSettings.Default.NTRIPPort = portNumber; + UserSettings.Default.NTRIPUsername = username.Text; + UserSettings.Default.NTRIPPassword = password.Password; + UserSettings.Default.Save(); if (MainWindow.monitor != null && !double.IsNaN(MainWindow.monitor.Latitude) && !double.IsNaN(MainWindow.monitor.Longitude)) { var lat = MainWindow.monitor.Latitude; diff --git a/src/SampleApp.WinDesktop/SampleApp.NetCore.csproj b/src/SampleApp.WinDesktop/SampleApp.NetCore.csproj index 33cc83c..3c8b1bf 100644 --- a/src/SampleApp.WinDesktop/SampleApp.NetCore.csproj +++ b/src/SampleApp.WinDesktop/SampleApp.NetCore.csproj @@ -25,4 +25,17 @@ PreserveNewest + + + True + True + UserSettings.settings + + + + + SettingsSingleFileGenerator + UserSettings.Designer.cs + + \ No newline at end of file diff --git a/src/SampleApp.WinDesktop/UserSettings.Designer.cs b/src/SampleApp.WinDesktop/UserSettings.Designer.cs new file mode 100644 index 0000000..27b9bf1 --- /dev/null +++ b/src/SampleApp.WinDesktop/UserSettings.Designer.cs @@ -0,0 +1,74 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SampleApp.WinDesktop { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")] + internal sealed partial class UserSettings : global::System.Configuration.ApplicationSettingsBase { + + private static UserSettings defaultInstance = ((UserSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new UserSettings()))); + + public static UserSettings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("esricaster.esri.com")] + public string NTRIPServer { + get { + return ((string)(this["NTRIPServer"])); + } + set { + this["NTRIPServer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2101")] + public int NTRIPPort { + get { + return ((int)(this["NTRIPPort"])); + } + set { + this["NTRIPPort"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string NTRIPUsername { + get { + return ((string)(this["NTRIPUsername"])); + } + set { + this["NTRIPUsername"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string NTRIPPassword { + get { + return ((string)(this["NTRIPPassword"])); + } + set { + this["NTRIPPassword"] = value; + } + } + } +} diff --git a/src/SampleApp.WinDesktop/UserSettings.settings b/src/SampleApp.WinDesktop/UserSettings.settings new file mode 100644 index 0000000..393cc10 --- /dev/null +++ b/src/SampleApp.WinDesktop/UserSettings.settings @@ -0,0 +1,18 @@ + + + + + + esricaster.esri.com + + + 2101 + + + + + + + + + \ No newline at end of file