private SetupModel ConvertSetup(IModelSetup setup)
        {
            var model = new SetupModel
            {
                Fullname           = setup.GetType().FullName,
                SortOrder          = setup.SortOrder,
                Name               = setup.Name,
                Description        = setup.Description,
                SupportedFileRegex = setup.SupportedFileRegex
            };

            return(model);
        }
Exemplo n.º 2
0
 private static IModelProvider <ISetup, IModelSetup, object> CreateWrappedModelProvider(ISetup setup, IModelSetup?modelSetup, Type modelType, IModelProvider modelProvider)
 {
     return((IModelProvider <ISetup, IModelSetup, object>)Activator.CreateInstance(
                typeof(ModelProviderAdapter <, ,>).MakeGenericType(setup.GetType(), modelSetup?.GetType() ?? typeof(IModelSetup), modelType),
                modelProvider));
 }