diff --git a/PROMS/Formats/Properties/Settings.Designer.cs b/PROMS/Formats/Properties/Settings.Designer.cs index bf54014c..c5993b74 100644 --- a/PROMS/Formats/Properties/Settings.Designer.cs +++ b/PROMS/Formats/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -22,5 +22,17 @@ namespace Formats.Properties { return defaultInstance; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string FormatPath { + get { + return ((string)(this["FormatPath"])); + } + set { + this["FormatPath"] = value; + } + } } } diff --git a/PROMS/Formats/Properties/Settings.settings b/PROMS/Formats/Properties/Settings.settings index 39645652..df5b11b7 100644 --- a/PROMS/Formats/Properties/Settings.settings +++ b/PROMS/Formats/Properties/Settings.settings @@ -1,7 +1,9 @@  - - - - - - + + + + + + + + \ No newline at end of file diff --git a/PROMS/Formats/frmFormatCopy.cs b/PROMS/Formats/frmFormatCopy.cs index f8430f2b..bd679eb1 100644 --- a/PROMS/Formats/frmFormatCopy.cs +++ b/PROMS/Formats/frmFormatCopy.cs @@ -19,9 +19,15 @@ namespace Formats private void SetDefaults() { - string curFolder = Environment.CurrentDirectory; // C:\development/PROMS/Formats/bin/debug - int idx = curFolder.ToUpper().IndexOf(@"\PROMS\"); - txbxPROMSFormatsPath.Text = curFolder.Substring(0, idx); + string savedFormatPath = Properties.Settings.Default.FormatPath ?? ""; // Get the last saved format copy path + if (savedFormatPath.Length > 0) + txbxPROMSFormatsPath.Text = savedFormatPath; + else + { + string curFolder = Environment.CurrentDirectory; // C:\development/PROMS/Formats/bin/debug + int idx = curFolder.ToUpper().IndexOf(@"\PROMS\"); + txbxPROMSFormatsPath.Text = curFolder.Substring(0, idx); + } } // This will create the folders if they don't exist or clear the contents if they do. @@ -139,6 +145,8 @@ namespace Formats if (fio.Exists && fio.IsReadOnly) fio.IsReadOnly = false; } } + Properties.Settings.Default.FormatPath = txbxPROMSFormatsPath.Text.Substring(0,txbxPROMSFormatsPath.Text.Length-1); // save the copy format path minus the ending backslash + Properties.Settings.Default.Save(); if(MessageBox.Show("Do you want to end the Format Copier?","Formats Copied.", MessageBoxButtons.YesNo, MessageBoxIcon.Question)== DialogResult.Yes)Application.Exit(); }