public static bool TagsAreEqual(IDictionary<string, string> first, IDictionary<string, string> second)
{
bool equal = false;
if (first.Count == second.Count)
{
equal = true;
foreach (var pair in first)
{
string value;
if (second.TryGetValue(pair.Key, out value))
{
if (!value.Equals(pair.Value))
{
equal = false;
break;
}
}
else
{
// Require key be present.
equal = false;
break;
}
}
}
return equal;
}