Exemplo n.º 1
0
        public static Builder UseExtensionsService(this Builder builder) => builder.Use(nameof(UseExtensionsService),
                                                                                        async context =>
        {
            ExtensionCollection res = new ExtensionCollection();
            Manager manager         = context.Services.GetManager();

            res.Load(new ExtensionLoader(typeof(Extensions.Builtin.Console.ConsoleExtension).Assembly));
            res.Load(new ExtensionLoader(typeof(Extensions.Builtin.Workspace.WorkspaceExtension).Assembly));

            foreach (System.Reflection.Assembly v in ExtensionDI.ExtensionAssemblies)
            {
                res.Load(new ExtensionLoader(v));
            }

            await res.LoadFromManager(manager, context.Logs);

            context.Services.Add <ExtensionCollection>(res);
            return(context.IgnoreResult());
        });