public static void UseManagementPages(this IGlobalConfiguration config, Assembly[] assemblies)
 {
     foreach (var assembly in assemblies)
     {
         JobsHelper.GetAllJobs(assembly);
     }
     CreateManagement();
 }
Esempio n. 2
0
        public static void AddManagementPages(this IServiceCollection services, IConfiguration config, IHostingEnvironment hostingEnvironment, params Assembly[] assemblies)
        {
            GlobalLoaderConfiguration.WebRootPath     = hostingEnvironment.WebRootPath;
            GlobalLoaderConfiguration.ContentRootPath = hostingEnvironment.ContentRootPath;

            services.LoadInstalledModules(hostingEnvironment, assemblies);

            foreach (var module in GlobalLoaderConfiguration.Modules)
            {
                JobsHelper.GetAllJobs(module.Assembly);
            }


            services.Build(config, hostingEnvironment);
        }
        private static void InitJobs(Assembly assembly)
        {
            var jobs       = JobsHelper.GetAllJobs(assembly);
            var methodMeta = jobs.Item1;
            var pages      = jobs.Item2;

            pages.ForEach(x => JobCategories.Add(x));
            methodMeta.ForEach(x => Jobs.Add(x));

            Jobs.CollectionChanged += (sender, e) => {
                if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
                {
                    foreach (JobMetadata v in e.NewItems)
                    {
                        //Add item to manager
                        //ManagementBasePage.Jobs.Add(v);
                        ManagementBasePage.AddCommands(v);
                    }
                }
            };
        }
 public static void UseManagementPages(this IGlobalConfiguration config, Assembly assembly)
 {
     JobsHelper.GetAllJobs(assembly);
     CreateManagement();
 }
 public static void UseManagementPages(this IGlobalConfiguration config, Assembly assembly, List <ManagementPageNavigation> navigation)
 {
     JobsHelper.GetAllJobs(assembly);
     CreateManagement(navigation);
 }