Widow
/trunk/Widow/Constants.cs |
@@ -1,4 +1,6 @@ |
using System.Reflection; |
using System; |
using System.IO; |
using System.Reflection; |
using System.Runtime.InteropServices; |
|
namespace Widow |
@@ -15,5 +17,18 @@ |
((GuidAttribute) Assembly.GetEntryAssembly().GetCustomAttributes(typeof(GuidAttribute), true)[0]).Value; |
|
#endregion |
|
#region Public Enums, Properties and Fields |
|
public static string WindowsSettingsFile => Path.Combine(UserApplicationDirectory, @"Windows.xml"); |
|
#endregion |
|
#region Private Delegates, Events, Enums, Properties, Indexers and Fields |
|
private static string UserApplicationDirectory => Path.Combine( |
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"Wizardry and Steamworks", @"Widow"); |
|
#endregion |
} |
} |
/trunk/Widow/MainForm.cs |
@@ -41,6 +41,12 @@ |
InitializeComponent(); |
AutoUpdater.Start("http://widow.grimore.org/update/update.xml"); |
|
// Upgrade settings if required. |
if (!ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).HasFile) |
{ |
Settings.Default.Upgrade(); |
} |
|
// Bind to settings changed event. |
Settings.Default.SettingsLoaded += Default_SettingsLoaded; |
Settings.Default.SettingsSaving += Default_SettingsSaving; |
@@ -128,7 +134,7 @@ |
RuleEditForm.Dispose(); |
RuleEditForm = null; |
|
switch (await WindowsSerialization.Serialize(Windows, "Windows.xml")) |
switch (await WindowsSerialization.Serialize(Windows, Constants.WindowsSettingsFile)) |
{ |
case SerializationSuccess serializationSuccess: |
if (LogForm != null) |
@@ -243,7 +249,7 @@ |
|
private async Task LoadWindows() |
{ |
switch (await WindowsSerialization.Deserialize("Windows.xml")) |
switch (await WindowsSerialization.Deserialize(Constants.WindowsSettingsFile)) |
{ |
case SerializationSuccess serializationSuccess: |
Windows = serializationSuccess.Windows; |
/trunk/Widow/Widow.csproj |
@@ -46,6 +46,7 @@ |
<HintPath>..\packages\MouseKeyHook.5.6.0\lib\net40\Gma.System.MouseKeyHook.dll</HintPath> |
</Reference> |
<Reference Include="System" /> |
<Reference Include="System.Configuration" /> |
<Reference Include="System.Core" /> |
<Reference Include="System.Runtime.Serialization" /> |
<Reference Include="System.Threading.Tasks.Dataflow, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> |
/trunk/Widow.sln.DotSettings |
@@ -1,3 +1,4 @@ |
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> |
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=Widow_002EAnnotations/@EntryIndexedValue">True</s:Boolean> |
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=Windows_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=Windows_002EAnnotations/@EntryIndexedValue">True</s:Boolean> |
<s:Boolean x:Key="/Default/UserDictionary/Words/=Steamworks/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |