private static EditorAttribute GetEditorAttribute(AttributeCollection attributes, Type editorBaseType)
{
foreach (Attribute attr in attributes)
{
EditorAttribute edAttr = attr as EditorAttribute;
if (edAttr != null)
{
Type attrEditorBaseType = Type.GetType(edAttr.EditorBaseTypeName);
if (attrEditorBaseType != null && attrEditorBaseType == editorBaseType)
{
return edAttr;
}
}
}
return null;
}