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.
abp/framework/test/Volo.Abp.AspNetCore.Mvc.UI..../AbpAspNetCoreMvcUiThemeBasi...

63 lines
2.2 KiB

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.IO;
5 years ago
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Menus;
5 years ago
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.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)));
});
}
5 years ago
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();
}
}
}