public override object GetEditor(Type editorBaseType)
{
object editor = this.editors[editorBaseType];
if(editor == null)
{
for(int i = 0; i < this.Attributes.Count; i++)
{
EditorAttribute attr = Attributes[i] as EditorAttribute;
if(attr == null)
{
continue;
}
Type editorType = Type.GetType(attr.EditorBaseTypeName);
if(editorBaseType == editorType)
{
Type type = GetTypeFromNameProperty(attr.EditorTypeName);
if(type != null)
{
editor = CreateInstance(type);
this.editors[type] = editor; // cache it
break;
}
}
}
}
return editor;
}