Files
BeWoPlaner/BeWoPlanerMobil/Global.asax.cs

65 lines
2.3 KiB
C#

using DevExpress.Web.Mvc;
using log4net.Config;
using System;
using System.Globalization;
using System.Net;
using System.Threading;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using BeWoPlanerMobil.Util.SchedulerUtils;
namespace BeWoPlanerMobil
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : HttpApplication
{
private readonly CultureInfo _CultureInfo = new CultureInfo("de-DE");
protected void Application_Start()
{
Thread.CurrentThread.CurrentCulture = _CultureInfo;
Thread.CurrentThread.CurrentUICulture = _CultureInfo;
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
XmlConfigurator.Configure();
OwnSoftSchedulerLocalizer.Activate();
// Für den Localizer. Für Release wieder entfernen und durch die Zeile darunter ersetzen
//DevExpress.Utils.Localization.XtraLocalizer.EnableTraceSource("BeWoPlanerMobil");
//RELEASE: DevExpress.Utils.Localization.XtraLocalizer.UserResourceManager = DXLocalization.ResourceManager;
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// ToDo: Könnte Probleme beim Login machen, falls der den Header der Login-Anfrage benutzt.
Response.Headers["Referrer-Policy"] = "no-referrer";
Thread.CurrentThread.CurrentCulture = _CultureInfo;
Thread.CurrentThread.CurrentUICulture = _CultureInfo;
}
protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
DevExpressHelper.Theme = "MaterialCompact";
DevExpress.Web.ASPxWebControl.GlobalThemeBaseColor = "#FF5A00";
Thread.CurrentThread.CurrentCulture = _CultureInfo;
Thread.CurrentThread.CurrentUICulture = _CultureInfo;
}
}
}