2018-08-03 12:08:40 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Web;
|
2019-02-13 12:12:23 +00:00
|
|
|
|
using log4net;
|
2018-08-03 12:08:40 +00:00
|
|
|
|
|
2019-02-13 12:12:23 +00:00
|
|
|
|
public class Global : HttpApplication
|
2018-08-03 12:08:40 +00:00
|
|
|
|
{
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-03 12:08:40 +00:00
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-08-03 12:08:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|