mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Now the settings correctly update visually after being reset.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Extreme.Net;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
namespace RuriLib.ViewModels
|
||||
{
|
||||
@@ -88,5 +90,19 @@ namespace RuriLib.ViewModels
|
||||
/// </summary>
|
||||
public string[] GlobalRetryKeys { get { return globalRetryKeys; } set { globalRetryKeys = value; OnPropertyChanged(); } }
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Resets the properties to their default value.
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
SettingsProxies def = new SettingsProxies();
|
||||
IList<PropertyInfo> props = new List<PropertyInfo>(typeof(SettingsProxies).GetProperties());
|
||||
|
||||
foreach (PropertyInfo prop in props)
|
||||
{
|
||||
prop.SetValue(this, prop.GetValue(def, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user