CLre/CLre_server/WebStatus/Attributes.cs

36 lines
No EOL
861 B
C#

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;
}
}
}