Initial WIP commit
Some checks failed
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Failing after 9s

This commit is contained in:
2026-01-27 18:58:09 -05:00
commit 853e8eab0d
45 changed files with 2920 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
namespace HardwareMonitorStatusWindow.StatusWindow;
internal class DataErrorDictionary : Dictionary<string, List<string>>
{
public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;
private void OnErrorsChanged(string propertyName)
{
ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
}
public IEnumerable GetErrors(string propertyName)
{
return TryGetValue(propertyName, out var value) ? value : null;
}
public void AddError(string propertyName, string error)
{
if (!ContainsKey(propertyName))
this[propertyName] = [];
if (this[propertyName].Contains(error))
return;
this[propertyName].Add(error);
OnErrorsChanged(propertyName);
}
public void ClearErrors(string propertyName)
{
if (!ContainsKey(propertyName))
return;
Remove(propertyName);
OnErrorsChanged(propertyName);
}
}