SPRX path now saves to app.

This commit is contained in:
Greg
2023-02-17 20:17:51 -07:00
parent ddaf748e4c
commit 44a93d7883
6 changed files with 86 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="OrbisLibraryManager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<OrbisLibraryManager.Properties.Settings>
<setting name="SPRXPath" serializeAs="String">
<value>/data/</value>
</setting>
</OrbisLibraryManager.Properties.Settings>
</userSettings>
</configuration>
+3 -2
View File
@@ -51,10 +51,11 @@
<simpleControls:SimpleTextField Name="SPRXPath"
FieldName="SPRX Path"
FieldText="/data/Frost Engine/BO3.sprx"
FieldText=""
IsReadOnly="False"
VerticalContentAlignment="Center"
Width="180"/>
Width="180"
LostFocus="SPRXPath_LostFocus"/>
<Grid Margin="0 6 0 0">
<Grid.ColumnDefinitions>
@@ -41,6 +41,9 @@ namespace OrbisLibraryManager
// Update State
Task.Run(() => EnableTargetOptions(TargetManager.SelectedTarget.Info.Status == TargetStatusType.APIAvailable));
// Load settings.
SPRXPath.FieldText = Properties.Settings.Default.SPRXPath;
}
private void RefreshLibraryList()
@@ -324,6 +327,12 @@ namespace OrbisLibraryManager
TargetManager.SelectedTarget.Shutdown();
}
private void SPRXPath_LostFocus(object sender, RoutedEventArgs e)
{
Properties.Settings.Default.SPRXPath = SPRXPath.FieldText;
Properties.Settings.Default.Save();
}
#endregion
}
}
@@ -79,6 +79,18 @@
<Compile Update="Controls\ImageButton.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
@@ -0,0 +1,38 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OrbisLibraryManager.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("/data/")]
public string SPRXPath {
get {
return ((string)(this["SPRXPath"]));
}
set {
this["SPRXPath"] = value;
}
}
}
}
@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="OrbisLibraryManager.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="SPRXPath" Type="System.String" Scope="User">
<Value Profile="(Default)">/data/</Value>
</Setting>
</Settings>
</SettingsFile>