helpcenter/helpcenter.r7-office.ru/Web/App_Code/Global.cs

46 lines
1.1 KiB
C#
Raw Normal View History

using System;
using System.Web;
2019-02-13 12:12:23 +00:00
using log4net;
2019-02-13 12:12:23 +00:00
public class Global : HttpApplication
{
2019-02-13 12:12:23 +00:00
private static readonly object Locker = new object();
private static volatile bool _initialized;
2019-02-13 14:39:16 +00:00
protected void Application_Start()
{
try
{
ClassNamePluralizer.LoadAndWatch(HttpContext.Current.Server.MapPath("~/App_Data/class_descriptions.xml"));
}
catch (Exception error)
{
LogManager.GetLogger("ASC").Error(error);
}
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
2019-02-13 12:12:23 +00:00
if (!_initialized)
{
lock (Locker)
{
if (!_initialized)
{
_initialized = true;
try
{
LogManager.GetLogger("ASC").Debug("Generate documentations");
Documentation.Load();
}
catch (Exception error)
{
LogManager.GetLogger("ASC").Error(error);
}
}
}
}
}
}