I have a Dictionary collection with integer array as a Key and Image as Value. I need to check whether if same key is already exists or not , before adding new int[]
.
I have tried below code, but the Dictionary.ContainsKey(int[])
method will always fails, even the same key
is already exists.
Dictionary<int[], Image> temp = new Dictionary<int[], Image>();
int[] rowcol = new int[]{rowIndex,colIndex};
if (!temp.ContainsKey(rowcol))
{
animatedImage = style.BackgroundImage;
temp.Add(rowcol, animatedImage);
}
Please suggest me how to check the int[]
key
in Dictionary
?
Thanks