Add project files.

This commit is contained in:
Daniel Clark
2022-11-01 15:26:08 +00:00
parent daa7b59f22
commit 7e4f880821
408 changed files with 16863 additions and 0 deletions
@@ -0,0 +1,38 @@
using System.Diagnostics.CodeAnalysis;
namespace TheXamlGuy.Framework.Core
{
public class PropertyValidationError<TKey, TValue> where TKey : class where TValue : class
{
private readonly Dictionary<TKey, TValue?> dictionary = new();
public int Count => dictionary.Count;
public TValue? this[[MaybeNull]TKey key]
{
get => dictionary.ContainsKey(key) ? dictionary[key] : null;
set
{
if (Contains(key))
{
dictionary.Remove(key);
}
dictionary.Add(key, value);
}
}
public bool Contains(TKey key)
{
return dictionary.ContainsKey(key);
}
public void Remove(TKey key)
{
if (Contains(key))
{
dictionary.Remove(key);
}
}
}
}