mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-27 21:43:14 +08:00
🐛
This commit is contained in:
@@ -36,7 +36,7 @@ sealed class SteamServiceImpl2 : SteamServiceBaseImpl, ISteamConnectService
|
||||
|
||||
public override ISteamConnectService Conn => this;
|
||||
|
||||
protected override string? StratSteamDefaultParameter => SteamSettings.SteamStratParameter.ActualValue;
|
||||
protected override string? StratSteamDefaultParameter => SteamSettings.SteamStratParameter.Value;
|
||||
|
||||
protected override bool IsRunSteamAdministrator => SteamSettings.IsRunSteamAdministrator.Value;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public abstract class SettingsPropertyBase
|
||||
public abstract void Reset();
|
||||
}
|
||||
|
||||
[DebuggerDisplay("Value={Value}, PropertyName={PropertyName}, AutoSave={AutoSave}")]
|
||||
[DebuggerDisplay("Value={ActualValue}, PropertyName={PropertyName}, AutoSave={AutoSave}")]
|
||||
public abstract class SettingsPropertyBase<TValue> : SettingsPropertyBase, INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -14,6 +14,7 @@ public class SettingsStructPropertyBase<TValue, [DynamicallyAccessedMembers(Dyna
|
||||
public SettingsStructPropertyBase(TValue? @default = default, bool autoSave = true, [CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
PropertyName = propertyName.ThrowIsNull();
|
||||
|
||||
AutoSave = autoSave;
|
||||
Default = @default;
|
||||
ParameterExpression parameter = Expression.Parameter(typeof(TSettings), "obj");
|
||||
|
||||
@@ -88,7 +88,12 @@ public class SettingsProperty<TValue, [DynamicallyAccessedMembers(DynamicallyAcc
|
||||
|
||||
public override void RaiseValueChanged(bool notSave = false)
|
||||
{
|
||||
setter(monitor.CurrentValue, value); // 赋值模型类属性
|
||||
var setter_value = value;
|
||||
if (EqualityComparer<TValue?>.Default.Equals(value, Default))
|
||||
{
|
||||
setter_value = default;
|
||||
}
|
||||
setter(monitor.CurrentValue, setter_value); // 赋值模型类属性
|
||||
OnValueChanged(value, value); // 调用变更事件
|
||||
if (!notSave && AutoSave) // 自动保存
|
||||
{
|
||||
|
||||
@@ -322,6 +322,7 @@ public abstract partial class Startup
|
||||
{
|
||||
ISettings<GeneralSettings_>.Load(configurationBuilder, directoryExists),
|
||||
ISettings<UISettings_>.Load(configurationBuilder, directoryExists),
|
||||
ISettings<SteamSettings_>.Load(configurationBuilder, directoryExists),
|
||||
};
|
||||
if (TryGetPlugins(out var plugins_cfg))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user