Initial commit

This commit is contained in:
Stone_Red
2026-06-08 12:30:37 +02:00
commit 2ba87a113d
310 changed files with 4457 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
using System.ComponentModel;
namespace RemSox.Utils;
public abstract class ChangedPropertiesTracker : INotifyPropertyChanged
{
private readonly Dictionary<string, object?> changedProperties = [];
public IReadOnlyDictionary<string, object?> ChangedProperties => changedProperties;
public event PropertyChangedEventHandler? PropertyChanged;
public bool AnyPropertyChanged => changedProperties.Count > 0;
protected void SetProperty<T>(string name, ref T field, T value)
{
if (!EqualityComparer<T>.Default.Equals(field, value))
{
field = value;
changedProperties[name] = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
public void ClearChangedProperties() => changedProperties.Clear();
public bool IsPropertyChanged(string name) => changedProperties.ContainsKey(name);
}