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,34 @@
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace TheXamlGuy.Framework.Core
{
public class PropertyBinderCollection : IPropertyBinderCollection
{
private readonly Dictionary<string, PropertyBinder> binders = new();
public int Count => binders.Count;
public void Add(string key, PropertyBinder binder)
{
binders.Add(key, binder);
}
public IEnumerator<PropertyBinder> GetEnumerator()
{
return binders.Select(x => x.Value).GetEnumerator();
}
public bool TryGet(string key, [MaybeNull] out PropertyBinder? value)
{
return binders.TryGetValue(key, out value);
}
IEnumerator IEnumerable.GetEnumerator()
{
return binders.Select(x => x.Value).GetEnumerator();
}
}
}