CLre/CLre_server/WebStatus/Attributes.cs

36 lines
861 B
C#
Raw Normal View History

using System.Reflection;
namespace CLre_server.WebStatus
{
public class Attributes
{
}
[System.AttributeUsage(System.AttributeTargets.Method)]
public class WebEndpointAttribute : System.Attribute
{
private readonly string endpoint;
public WebEndpointAttribute(string path)
{
endpoint = path;
Assembly asm = Assembly.GetCallingAssembly();
if (!WebServer._assembliesToCheck.Contains(asm))
{
WebServer._assembliesToCheck.Add(asm);
}
if (WebServer.MainInstance != null && WebServer.MainInstance.IsRunning)
{
// Web server is already running
// TODO
}
}
internal string GetPath()
{
return endpoint;
}
}
}