Microsoft.VisualStudio.Project.DesignPropertyDescriptor.GetEditor C# (CSharp) Method

GetEditor() public method

Delegates to base.
public GetEditor ( Type editorBaseType ) : object
editorBaseType System.Type
return object
        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;
        }