mirror of https://github.com/abpframework/abp
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							63 lines
						
					
					
						
							2.1 KiB
						
					
					
				
			
		
		
	
	
							63 lines
						
					
					
						
							2.1 KiB
						
					
					
				using System.IO;
 | 
						|
using Microsoft.AspNetCore.Builder;
 | 
						|
using Microsoft.Extensions.DependencyInjection;
 | 
						|
using Microsoft.Extensions.Hosting;
 | 
						|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
 | 
						|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling;
 | 
						|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo;
 | 
						|
using Volo.Abp.Autofac;
 | 
						|
using Volo.Abp.Modularity;
 | 
						|
using Volo.Abp.UI;
 | 
						|
using Volo.Abp.UI.Navigation;
 | 
						|
using Volo.Abp.VirtualFileSystem;
 | 
						|
 | 
						|
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo
 | 
						|
{
 | 
						|
    [DependsOn(
 | 
						|
        typeof(AbpAspNetCoreMvcUiBasicThemeModule),
 | 
						|
        typeof(AbpAspNetCoreMvcUiThemeSharedDemoModule),
 | 
						|
        typeof(AbpAutofacModule)
 | 
						|
        )]
 | 
						|
    public class AbpAspNetCoreMvcUiThemeBasicDemoModule : AbpModule
 | 
						|
    {
 | 
						|
        public override void ConfigureServices(ServiceConfigurationContext context)
 | 
						|
        {
 | 
						|
            var env = context.Services.GetHostingEnvironment();
 | 
						|
 | 
						|
            if (env.IsDevelopment())
 | 
						|
            {
 | 
						|
                Configure<AbpVirtualFileSystemOptions>(options =>
 | 
						|
                {
 | 
						|
                    options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedDemoModule>(Path.Combine(env.ContentRootPath, string.Format("..{0}..{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo", Path.DirectorySeparatorChar)));
 | 
						|
                });
 | 
						|
            }
 | 
						|
 | 
						|
            Configure<AbpBundlingOptions>(options =>
 | 
						|
            {
 | 
						|
                options.StyleBundles
 | 
						|
                    .Get(StandardBundles.Styles.Global)
 | 
						|
                    .AddFiles("/demo/styles/main.css");
 | 
						|
            });
 | 
						|
 | 
						|
            Configure<AbpNavigationOptions>(options =>
 | 
						|
            {
 | 
						|
                options.MenuContributors.Add(new BasicThemeDemoMenuContributor());
 | 
						|
            });
 | 
						|
        }
 | 
						|
 | 
						|
        public override void OnApplicationInitialization(ApplicationInitializationContext context)
 | 
						|
        {
 | 
						|
            var app = context.GetApplicationBuilder();
 | 
						|
            var env = context.GetEnvironment();
 | 
						|
 | 
						|
            if (env.IsDevelopment())
 | 
						|
            {
 | 
						|
                app.UseDeveloperExceptionPage();
 | 
						|
            }
 | 
						|
 | 
						|
            app.UseVirtualFiles();
 | 
						|
            app.UseRouting();
 | 
						|
            app.UseMvcWithDefaultRouteAndArea();
 | 
						|
        }
 | 
						|
    }
 | 
						|
} |