private TreeNode FindBestMatchByProperties(ComponentName name)
{
TreeNode current = this;
while (current != null)
{
bool selected = true;
foreach (DictionaryEntry entry in name.Properties)
{
String value = current.CompName.Properties[entry.Key] as String;
if (value == null || !value.Equals(entry.Value))
{
selected = false;
break;
}
}
if (selected) break;
current = current.NextSibling;
}
return current;
}
}