Ejemplo n.º 1
0
        public async Task <Toolbar> GetAsync(string name)
        {
            var toolbar = new Toolbar(name);

            using (var scope = ServiceProvider.CreateScope())
            {
                var context = new ToolbarConfigurationContext(ThemeManager.CurrentTheme, toolbar, scope.ServiceProvider);

                foreach (var contributor in Options.Contributors)
                {
                    await contributor.ConfigureToolbarAsync(context);
                }
            }

            return(toolbar);
        }
Ejemplo n.º 2
0
        public async Task <Toolbar> GetAsync(string name)
        {
            var toolbar = new Toolbar(name);

            using (var scope = ServiceProvider.CreateScope())
            {
                RequirePermissionsSimpleBatchStateChecker <ToolbarItem> .Instance.ClearCheckModels();

                var context = new ToolbarConfigurationContext(ThemeManager.CurrentTheme, toolbar, scope.ServiceProvider);

                foreach (var contributor in Options.Contributors)
                {
                    await contributor.ConfigureToolbarAsync(context);
                }

                await CheckPermissionsAsync(scope.ServiceProvider, toolbar);
            }

            return(toolbar);
        }