implement Contains on HandleDictionary

This commit is contained in:
Michael Becker 2021-10-28 15:29:22 -04:00
parent 71aa88c716
commit 9c7a3c89f1
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -23,7 +23,6 @@ namespace MBS.Framework.Collections.Generic
{ {
public class HandleDictionary<TObject> : HandleDictionary<TObject, IntPtr> public class HandleDictionary<TObject> : HandleDictionary<TObject, IntPtr>
{ {
} }
public class HandleDictionary<TObject, THandle> public class HandleDictionary<TObject, THandle>
{ {
@ -44,6 +43,15 @@ namespace MBS.Framework.Collections.Generic
_dict.Add(handle, obj); _dict.Add(handle, obj);
} }
public bool Contains(TObject obj)
{
return _dict.ContainsValue2(obj);
}
public bool Contains(THandle handle)
{
return _dict.ContainsValue1(handle);
}
/// <summary> /// <summary>
/// Removes the <typeparamref name="THandle" /> of the given <paramref name="obj" />. /// Removes the <typeparamref name="THandle" /> of the given <paramref name="obj" />.
/// </summary> /// </summary>