System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetEditorAttribute C# (CSharp) Method

GetEditorAttribute() private static method

Helper method to return an editor attribute of the correct base type.
private static GetEditorAttribute ( AttributeCollection attributes, Type editorBaseType ) : EditorAttribute
attributes AttributeCollection
editorBaseType System.Type
return EditorAttribute
            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;
            }