Пример #1
0
 public void LoadEditor(Assembly editorAssembly)
 {
     foreach (Type t in editorAssembly.GetTypes())
     {
         foreach (Attribute currentAttribute in Attribute.GetCustomAttributes(t))
         {
             if (currentAttribute.GetType() == typeof(PropertyEditorTypeAttribute))
             {
                 PropertyEditorTypeAttribute peta = (PropertyEditorTypeAttribute)currentAttribute;
                 Type editsType = peta.Type;
                 if (t.IsSubclassOf(typeof(BaseEditor)))
                 {
                     if (peta.Inherits)
                     {
                         inheritingEditors.Add(editsType, t);
                     }
                     else
                     {
                         editors.Add(editsType, t);
                     }
                 }
             }
             else if (currentAttribute.GetType() == typeof(SurrogateUITypeEditorAttribute))
             {
                 Type editsType = (currentAttribute as SurrogateUITypeEditorAttribute).Type;
                 surrogates.Add(editsType, t);
             }
         }
     }
 }