Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #55 from Toyz/master
Browse files Browse the repository at this point in the history
Added Get<T> to settings now :D
  • Loading branch information
Toyz committed Aug 2, 2015
2 parents f9d0c3d + 43b5989 commit 811b1b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions W10 BG Logon Changer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public MainWindow()
Settings.Set("eula", true);
Settings.Save();

Debug.WriteLine("[EULA Test] {0}", Settings.Get<bool>("eula"));

SettingFlyout.Content = new BgEditorControl(this);
SettingFlyout.IsOpen = true;

Expand Down
7 changes: 7 additions & 0 deletions W10 BG Logon Changer/Tools/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ public static T Get<T>(string key, T @default)
return @default;
}

public static T Get<T>(string key) where T : new()
{
if(!Exist(key)) return new T();

return (T) _settingsObject[key];
}

public static void Set<T>(string key, T @value)
{
if (Exist(key) && _settingsObject[key] != null)
Expand Down

0 comments on commit 811b1b0

Please sign in to comment.