public DbEditorVM(IServiceProvider managerCollection, DbEntryEditorFactory dbEntryEditorFactory, IRepositoryProvider repositoryProvider) { this.managerCollection = managerCollection; this.dbEntryEditorFactory = dbEntryEditorFactory; this.repositoryProvider = repositoryProvider; }
public static void SetupDbEntryEditorFactory(this IHostBuilder hostBuilder) { hostBuilder.ConfigureServices((hostContext, services) => { services.AddSingleton <DbEntryEditorFactory>((sp) => { var entryEditorFactory = new DbEntryEditorFactory(sp); entryEditorFactory.Register <IRepository <IDbTileAtlas>, TileSetEditorVM>(); entryEditorFactory.Register <IRepository <IDbSpriteAtlas>, SpriteSetEditorVM>(); entryEditorFactory.Register <IRepository <IDbActionSet>, ActionSetEditorVM>(); entryEditorFactory.Register <IRepository <IDbPalette>, PaletteEditorVM>(); entryEditorFactory.Register <IRepository <IDbText>, TextEditorVM>(); entryEditorFactory.Register <IRepository <IDbScript>, ScriptEditorVM>(); entryEditorFactory.Register <IRepository <IDbEntityTemplate>, EntityTemplateEditorVM>(); entryEditorFactory.Register <IRepository <IDbImage>, ImageEditorVM>(); entryEditorFactory.Register <IRepository <IDbSound>, SoundEditorVM>(); entryEditorFactory.Register <IRepository <IDbMap>, MapEditorVM>(); entryEditorFactory.Register <IRepository <IDbDataSource>, DataSourceEditorVM>(); return(entryEditorFactory); }); }); }