ServiceActionListBuilder.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #pragma warning disable CS1591
  2. #pragma warning disable SA1600
  3. using System.Collections.Generic;
  4. using Emby.Dlna.Common;
  5. namespace Emby.Dlna.MediaReceiverRegistrar
  6. {
  7. public class ServiceActionListBuilder
  8. {
  9. public IEnumerable<ServiceAction> GetActions()
  10. {
  11. return new[]
  12. {
  13. GetIsValidated(),
  14. GetIsAuthorized(),
  15. GetRegisterDevice(),
  16. GetGetAuthorizationDeniedUpdateID(),
  17. GetGetAuthorizationGrantedUpdateID(),
  18. GetGetValidationRevokedUpdateID(),
  19. GetGetValidationSucceededUpdateID()
  20. };
  21. }
  22. private static ServiceAction GetIsValidated()
  23. {
  24. var action = new ServiceAction
  25. {
  26. Name = "IsValidated"
  27. };
  28. action.ArgumentList.Add(new Argument
  29. {
  30. Name = "DeviceID",
  31. Direction = "in"
  32. });
  33. action.ArgumentList.Add(new Argument
  34. {
  35. Name = "Result",
  36. Direction = "out"
  37. });
  38. return action;
  39. }
  40. private static ServiceAction GetIsAuthorized()
  41. {
  42. var action = new ServiceAction
  43. {
  44. Name = "IsAuthorized"
  45. };
  46. action.ArgumentList.Add(new Argument
  47. {
  48. Name = "DeviceID",
  49. Direction = "in"
  50. });
  51. action.ArgumentList.Add(new Argument
  52. {
  53. Name = "Result",
  54. Direction = "out"
  55. });
  56. return action;
  57. }
  58. private static ServiceAction GetRegisterDevice()
  59. {
  60. var action = new ServiceAction
  61. {
  62. Name = "RegisterDevice"
  63. };
  64. action.ArgumentList.Add(new Argument
  65. {
  66. Name = "RegistrationReqMsg",
  67. Direction = "in"
  68. });
  69. action.ArgumentList.Add(new Argument
  70. {
  71. Name = "RegistrationRespMsg",
  72. Direction = "out"
  73. });
  74. return action;
  75. }
  76. private static ServiceAction GetGetValidationSucceededUpdateID()
  77. {
  78. var action = new ServiceAction
  79. {
  80. Name = "GetValidationSucceededUpdateID"
  81. };
  82. action.ArgumentList.Add(new Argument
  83. {
  84. Name = "ValidationSucceededUpdateID",
  85. Direction = "out"
  86. });
  87. return action;
  88. }
  89. private ServiceAction GetGetAuthorizationDeniedUpdateID()
  90. {
  91. var action = new ServiceAction
  92. {
  93. Name = "GetAuthorizationDeniedUpdateID"
  94. };
  95. action.ArgumentList.Add(new Argument
  96. {
  97. Name = "AuthorizationDeniedUpdateID",
  98. Direction = "out"
  99. });
  100. return action;
  101. }
  102. private ServiceAction GetGetValidationRevokedUpdateID()
  103. {
  104. var action = new ServiceAction
  105. {
  106. Name = "GetValidationRevokedUpdateID"
  107. };
  108. action.ArgumentList.Add(new Argument
  109. {
  110. Name = "ValidationRevokedUpdateID",
  111. Direction = "out"
  112. });
  113. return action;
  114. }
  115. private ServiceAction GetGetAuthorizationGrantedUpdateID()
  116. {
  117. var action = new ServiceAction
  118. {
  119. Name = "GetAuthorizationGrantedUpdateID"
  120. };
  121. action.ArgumentList.Add(new Argument
  122. {
  123. Name = "AuthorizationGrantedUpdateID",
  124. Direction = "out"
  125. });
  126. return action;
  127. }
  128. }
  129. }