mhhh, you should not be afraid of brackets.
foreach (var item in pl_dict[token])
if (item.Method.ToString() == callback.Method.ToString())
found = true;
The problem is with item.Method.ToString()
, try just comparing the action objects, like this:
foreach (var item in pl_dict[token])
{
if (item == callback)
{
found = true;
break; // no need to continue
}
}
BTW, why didn't you use pl_dict[token].Contains(callback)
, y should work:
if (!pl_dict[token].Contains(callback))
{
pl_dict[token].Add(callback);
}