Unofficial CardLife revival project, pronounced like "celery"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
861B

  1. using System.Reflection;
  2. namespace CLre_server.WebStatus
  3. {
  4. public class Attributes
  5. {
  6. }
  7. [System.AttributeUsage(System.AttributeTargets.Method)]
  8. public class WebEndpointAttribute : System.Attribute
  9. {
  10. private readonly string endpoint;
  11. public WebEndpointAttribute(string path)
  12. {
  13. endpoint = path;
  14. Assembly asm = Assembly.GetCallingAssembly();
  15. if (!WebServer._assembliesToCheck.Contains(asm))
  16. {
  17. WebServer._assembliesToCheck.Add(asm);
  18. }
  19. if (WebServer.MainInstance != null && WebServer.MainInstance.IsRunning)
  20. {
  21. // Web server is already running
  22. // TODO
  23. }
  24. }
  25. internal string GetPath()
  26. {
  27. return endpoint;
  28. }
  29. }
  30. }