Пример #1
0
        public static InlineEditorTypes GetTypes <ItemType>()
        {
            var editorTypes = new List <Type> {
                null
            };
            var itemTypes = new List <Type> {
                null
            };
            var typeNames = new List <string> {
                "<null>"
            };

            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                foreach (var itemType in assembly.GetExportedTypes())
                {
                    if (TypeFinder.IsCreatableAs <ItemType>(itemType))
                    {
                        var editorType = GetEditorForType(itemType);
                        editorTypes.Add(editorType);
                        itemTypes.Add(itemType);
                        typeNames.Add(itemType.Name);
                    }
                }
            }

            return(new InlineEditorTypes
            {
                Count = editorTypes.Count,
                EditorTypes = editorTypes.ToArray(),
                ItemTypes = itemTypes.ToArray(),
                TypeNames = typeNames.ToArray()
            });
        }
Пример #2
0
 static InlineEditor()
 {
     foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
     {
         foreach (var type in assembly.GetExportedTypes())
         {
             if (TypeFinder.IsCreatableAs <InlineEditor>(type))
             {
                 _inlineEditorTypes.Add(type);
             }
         }
     }
 }