mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
added ISettingsManager implementation.
This commit is contained in:
@@ -1008,6 +1008,7 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Strings\arcStrings.ru-RU.resx" />
|
<EmbeddedResource Include="Strings\arcStrings.ru-RU.resx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PreBuildEvent>perl "$(SolutionDir)inc-revision.pl" "$(ProjectPath)" $(ConfigurationName)
|
<PreBuildEvent>perl "$(SolutionDir)inc-revision.pl" "$(ProjectPath)" $(ConfigurationName)
|
||||||
|
|||||||
12
ArcFormats/Properties/Settings.Designer.cs
generated
12
ArcFormats/Properties/Settings.Designer.cs
generated
@@ -705,5 +705,17 @@ namespace GameRes.Formats.Properties {
|
|||||||
this["RCTApplyMask"] = value;
|
this["RCTApplyMask"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
|
public bool UpgradeRequired {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["UpgradeRequired"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["UpgradeRequired"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,18 +19,6 @@ namespace GameRes.Formats.Properties {
|
|||||||
//
|
//
|
||||||
// this.SettingsSaving += this.SettingsSavingEventHandler;
|
// this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||||
//
|
//
|
||||||
|
|
||||||
if (null != Application.Current)
|
|
||||||
{
|
|
||||||
Application.Current.Dispatcher.BeginInvoke (DispatcherPriority.Normal, new Action(() => {
|
|
||||||
Application.Current.Exit += ApplicationExitHandler;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApplicationExitHandler (object sender, System.Windows.ExitEventArgs args)
|
|
||||||
{
|
|
||||||
Default.Save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
|
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
|
||||||
|
|||||||
@@ -173,5 +173,8 @@
|
|||||||
<Setting Name="RCTApplyMask" Type="System.Boolean" Scope="User">
|
<Setting Name="RCTApplyMask" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">True</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
//! \brief Persistent resource settings implementation.
|
//! \brief Persistent resource settings implementation.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
using System.ComponentModel.Composition;
|
||||||
|
|
||||||
namespace GameRes.Formats
|
namespace GameRes.Formats
|
||||||
{
|
{
|
||||||
internal class LocalResourceSetting : ResourceSettingBase
|
internal class LocalResourceSetting : ResourceSettingBase
|
||||||
@@ -12,4 +14,23 @@ namespace GameRes.Formats
|
|||||||
set { Properties.Settings.Default[Name] = value; }
|
set { Properties.Settings.Default[Name] = value; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Export(typeof(ISettingsManager))]
|
||||||
|
internal class SettingsManager : ISettingsManager
|
||||||
|
{
|
||||||
|
public void UpgradeSettings ()
|
||||||
|
{
|
||||||
|
if (Properties.Settings.Default.UpgradeRequired)
|
||||||
|
{
|
||||||
|
Properties.Settings.Default.Upgrade();
|
||||||
|
Properties.Settings.Default.UpgradeRequired = false;
|
||||||
|
Properties.Settings.Default.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveSettings ()
|
||||||
|
{
|
||||||
|
Properties.Settings.Default.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,9 @@
|
|||||||
<setting name="RCTApplyMask" serializeAs="String">
|
<setting name="RCTApplyMask" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="UpgradeRequired" serializeAs="String">
|
||||||
|
<value>True</value>
|
||||||
|
</setting>
|
||||||
</GameRes.Formats.Properties.Settings>
|
</GameRes.Formats.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
|
||||||
|
|||||||
Reference in New Issue
Block a user