Пример #1
0
        internal void ReadTypes(Dictionary <string, Type> types, Dictionary <string, Type> configTypes, Dictionary <string, Func <GridControl, GridControlWrapper> > wrapperFuncs)
        {
            InitWrapperMethods();



            foreach (var type in TypeLoader.GetAttributedTypes <GridConverterAttribute>())
            {
                var attr = type.GetCustomAttribute <GridConverterAttribute>();
                Contract.Assert(typeof(IGridControlValue).IsAssignableFrom(type), $"Type {type.FullName} with GridConverterAttribute {attr.EditorAlias} must implement IGridControlValue");

                Contract.Assert(type.GetConstructor(ConstructorArgs) != null, "GridControlValue should have a constructor matching ");

                types[attr.EditorAlias]        = type;
                configTypes[attr.EditorAlias]  = attr.ConfigType; // this might be null
                wrapperFuncs[attr.EditorAlias] =
                    (GridControl gridControl) => GetWrapperMethod(type, attr.ConfigType).Invoke(gridControl, Type.EmptyTypes) as GridControlWrapper;
            }
        }