-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUnityAspNetCoreMvcUIThemeUX2Module.cs
More file actions
86 lines (76 loc) · 2.91 KB
/
UnityAspNetCoreMvcUIThemeUX2Module.cs
File metadata and controls
86 lines (76 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using Markdig;
using Microsoft.Extensions.DependencyInjection;
using Unity.AspNetCore.Mvc.UI.Theme.UX2.Bundling;
using Unity.AspNetCore.Mvc.UI.Theme.UX2.Toolbars;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars;
using Volo.Abp.AspNetCore.Mvc.UI.Theming;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace Unity.AspNetCore.Mvc.UI.Theme.UX2;
[DependsOn(
typeof(AbpAspNetCoreMvcUiThemeSharedModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule)
)]
public class UnityAspNetCoreMvcUIThemeUX2Module : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(UnityAspNetCoreMvcUIThemeUX2Module).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpThemingOptions>(options =>
{
options.Themes.Add<UnityUX2Theme>();
if (options.DefaultThemeName == null)
{
options.DefaultThemeName = UnityUX2Theme.Name;
}
});
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<UnityAspNetCoreMvcUIThemeUX2Module>("Unity.AspNetCore.Mvc.UI.Theme.UX2");
});
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new UnityThemeMainTopToolbarContributor());
});
Configure<AbpBundlingOptions>(options =>
{
options
.StyleBundles
.Add(UnityThemeUX2Bundles.Styles.Global, bundle =>
{
bundle
.AddBaseBundles(StandardBundles.Styles.Global)
.AddContributors(typeof(UnityThemeUX2GlobalStyleContributor));
});
options
.ScriptBundles
.Add(UnityThemeUX2Bundles.Scripts.Global, bundle =>
{
bundle
.AddBaseBundles(StandardBundles.Scripts.Global)
.AddContributors(typeof(UnityThemeUX2GlobalScriptContributor));
});
});
context.Services.AddSingleton(_ => new MarkdownPipelineBuilder()
.UseAutoLinks(new Markdig.Extensions.AutoLinks.AutoLinkOptions {
OpenInNewWindow = true,
UseHttpsForWWWLinks = true,
AllowDomainWithoutPeriod = false
})
.UseReferralLinks("nofollow", "noopener", "noreferrer")
.UseSoftlineBreakAsHardlineBreak()
.DisableHeadings()
.DisableHtml()
.Build());
}
}