implement required method

This commit is contained in:
13xforever 2020-09-29 17:49:57 +05:00
parent 5d064708ec
commit 48b46223ec

View File

@ -87,10 +87,19 @@ namespace CompatBot.Utils
return true;
}
public void CopyTo(TValue[] array, int arrayIndex)
{
var available = array.Length-arrayIndex;
if (available < Count)
throw new ArgumentException($"Insufficient lenght of the destination array: available={available}, required={Count}");
for (var i = 0; i < Count; i++)
array[arrayIndex + i] = lookup[keyList[i]];
}
public bool Contains(TKey key) => lookup.ContainsKey(key);
public bool Contains(TValue item) => Contains(makeKey(item));
public void CopyTo(TValue[] array, int arrayIndex) => throw new NotSupportedException();
public int IndexOf(TValue item) => throw new NotSupportedException();
public void Insert(int index, TValue item) => throw new NotSupportedException();
public void RemoveAt(int index) => throw new NotSupportedException();