46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using System;
|
|
using System.Web;
|
|
using log4net;
|
|
|
|
public class Global : HttpApplication
|
|
{
|
|
private static readonly object Locker = new object();
|
|
private static volatile bool _initialized;
|
|
|
|
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)
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|