public static void MapHandlers()
{
foreach (MethodInfo methodInfo in typeof(HttpServer).GetMethods(BindingFlags.NonPublic | BindingFlags.Static))
{
var attributes = methodInfo.GetCustomAttributes(typeof(HttpHandlerAttribute), false);
if (attributes.Length < 1) continue;
HttpHandlerAttribute attribute = (HttpHandlerAttribute)attributes[0];
if (_handlers.ContainsKey(attribute.Url)) continue;
_handlers.Add(attribute.Url, new KeyValuePair<HttpHandlerAttribute, HttpHandlerDelegate>(attribute, (HttpHandlerDelegate)Delegate.CreateDelegate(typeof(HttpHandlerDelegate), methodInfo)));
Log.Info("Handler", "Mapped handler for '" + attribute.Url + "'");
}
Log.Succes("HttpServer.MapHandlers", "HTTP handlers mapped");
}