UnitTestGenericServices.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. // Generated by ProtoGen, Version=2.4.1.521, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT!
  2. #pragma warning disable 1591, 0612, 3021
  3. #region Designer generated code
  4. using pb = global::Google.ProtocolBuffers;
  5. using pbc = global::Google.ProtocolBuffers.Collections;
  6. using pbd = global::Google.ProtocolBuffers.Descriptors;
  7. using scg = global::System.Collections.Generic;
  8. namespace Google.ProtocolBuffers.TestProtos {
  9. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  10. public static partial class UnitTestGenericServices {
  11. #region Extension registration
  12. public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
  13. }
  14. #endregion
  15. #region Static variables
  16. #endregion
  17. #region Descriptor
  18. public static pbd::FileDescriptor Descriptor {
  19. get { return descriptor; }
  20. }
  21. private static pbd::FileDescriptor descriptor;
  22. static UnitTestGenericServices() {
  23. byte[] descriptorData = global::System.Convert.FromBase64String(
  24. string.Concat(
  25. "CiZleHRlc3QvdW5pdHRlc3RfZ2VuZXJpY19zZXJ2aWNlcy5wcm90bxIRcHJv",
  26. "dG9idWZfdW5pdHRlc3QaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9u",
  27. "cy5wcm90bxoeZ29vZ2xlL3Byb3RvYnVmL3VuaXR0ZXN0LnByb3RvGi1nb29n",
  28. "bGUvcHJvdG9idWYvdW5pdHRlc3RfY3VzdG9tX29wdGlvbnMucHJvdG8yoAEK",
  29. "ElRlc3RHZW5lcmljU2VydmljZRJECgNGb28SHS5wcm90b2J1Zl91bml0dGVz",
  30. "dC5Gb29SZXF1ZXN0Gh4ucHJvdG9idWZfdW5pdHRlc3QuRm9vUmVzcG9uc2US",
  31. "RAoDQmFyEh0ucHJvdG9idWZfdW5pdHRlc3QuQmFyUmVxdWVzdBoeLnByb3Rv",
  32. "YnVmX3VuaXR0ZXN0LkJhclJlc3BvbnNlMpUBCiNUZXN0R2VuZXJpY1NlcnZp",
  33. "Y2VXaXRoQ3VzdG9tT3B0aW9ucxJjCgNGb28SKS5wcm90b2J1Zl91bml0dGVz",
  34. "dC5DdXN0b21PcHRpb25Gb29SZXF1ZXN0GioucHJvdG9idWZfdW5pdHRlc3Qu",
  35. "Q3VzdG9tT3B0aW9uRm9vUmVzcG9uc2UiBeD6jB4CGgmQsose09uAy0lCREgB",
  36. "wj4/CiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MSF1VuaXRU",
  37. "ZXN0R2VuZXJpY1NlcnZpY2VziA4B"));
  38. pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
  39. descriptor = root;
  40. pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();
  41. RegisterAllExtensions(registry);
  42. global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry);
  43. global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RegisterAllExtensions(registry);
  44. global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.RegisterAllExtensions(registry);
  45. return registry;
  46. };
  47. pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
  48. new pbd::FileDescriptor[] {
  49. global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor,
  50. global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor,
  51. global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor,
  52. }, assigner);
  53. }
  54. #endregion
  55. }
  56. #region Services
  57. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  58. public abstract class TestGenericService : pb::IService {
  59. public abstract void Foo(
  60. pb::IRpcController controller,
  61. global::Google.ProtocolBuffers.TestProtos.FooRequest request,
  62. global::System.Action<global::Google.ProtocolBuffers.TestProtos.FooResponse> done);
  63. public abstract void Bar(
  64. pb::IRpcController controller,
  65. global::Google.ProtocolBuffers.TestProtos.BarRequest request,
  66. global::System.Action<global::Google.ProtocolBuffers.TestProtos.BarResponse> done);
  67. public static pbd::ServiceDescriptor Descriptor {
  68. get { return UnitTestGenericServices.Descriptor.Services[0]; }
  69. }
  70. public pbd::ServiceDescriptor DescriptorForType {
  71. get { return Descriptor; }
  72. }
  73. public void CallMethod(
  74. pbd::MethodDescriptor method,
  75. pb::IRpcController controller,
  76. pb::IMessage request,
  77. global::System.Action<pb::IMessage> done) {
  78. if (method.Service != Descriptor) {
  79. throw new global::System.ArgumentException(
  80. "Service.CallMethod() given method descriptor for wrong service type.");
  81. }
  82. switch(method.Index) {
  83. case 0:
  84. this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.FooRequest) request,
  85. pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse>(
  86. done));
  87. return;
  88. case 1:
  89. this.Bar(controller, (global::Google.ProtocolBuffers.TestProtos.BarRequest) request,
  90. pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse>(
  91. done));
  92. return;
  93. default:
  94. throw new global::System.InvalidOperationException("Can't get here.");
  95. }
  96. }
  97. public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) {
  98. if (method.Service != Descriptor) {
  99. throw new global::System.ArgumentException(
  100. "Service.GetRequestPrototype() given method descriptor for wrong service type.");
  101. }
  102. switch(method.Index) {
  103. case 0:
  104. return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance;
  105. case 1:
  106. return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance;
  107. default:
  108. throw new global::System.InvalidOperationException("Can't get here.");
  109. }
  110. }
  111. public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
  112. if (method.Service != Descriptor) {
  113. throw new global::System.ArgumentException(
  114. "Service.GetResponsePrototype() given method descriptor for wrong service type.");
  115. }
  116. switch(method.Index) {
  117. case 0:
  118. return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance;
  119. case 1:
  120. return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance;
  121. default:
  122. throw new global::System.InvalidOperationException("Can't get here.");
  123. }
  124. }
  125. public static Stub CreateStub(pb::IRpcChannel channel) {
  126. return new Stub(channel);
  127. }
  128. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  129. public class Stub : global::Google.ProtocolBuffers.TestProtos.TestGenericService {
  130. internal Stub(pb::IRpcChannel channel) {
  131. this.channel = channel;
  132. }
  133. private readonly pb::IRpcChannel channel;
  134. public pb::IRpcChannel Channel {
  135. get { return channel; }
  136. }
  137. public override void Foo(
  138. pb::IRpcController controller,
  139. global::Google.ProtocolBuffers.TestProtos.FooRequest request,
  140. global::System.Action<global::Google.ProtocolBuffers.TestProtos.FooResponse> done) {
  141. channel.CallMethod(Descriptor.Methods[0],
  142. controller, request, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance,
  143. pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse, global::Google.ProtocolBuffers.TestProtos.FooResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance));
  144. }
  145. public override void Bar(
  146. pb::IRpcController controller,
  147. global::Google.ProtocolBuffers.TestProtos.BarRequest request,
  148. global::System.Action<global::Google.ProtocolBuffers.TestProtos.BarResponse> done) {
  149. channel.CallMethod(Descriptor.Methods[1],
  150. controller, request, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance,
  151. pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse, global::Google.ProtocolBuffers.TestProtos.BarResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance));
  152. }
  153. }
  154. }
  155. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  156. public abstract class TestGenericServiceWithCustomOptions : pb::IService {
  157. public abstract void Foo(
  158. pb::IRpcController controller,
  159. global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest request,
  160. global::System.Action<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse> done);
  161. public static pbd::ServiceDescriptor Descriptor {
  162. get { return UnitTestGenericServices.Descriptor.Services[1]; }
  163. }
  164. public pbd::ServiceDescriptor DescriptorForType {
  165. get { return Descriptor; }
  166. }
  167. public void CallMethod(
  168. pbd::MethodDescriptor method,
  169. pb::IRpcController controller,
  170. pb::IMessage request,
  171. global::System.Action<pb::IMessage> done) {
  172. if (method.Service != Descriptor) {
  173. throw new global::System.ArgumentException(
  174. "Service.CallMethod() given method descriptor for wrong service type.");
  175. }
  176. switch(method.Index) {
  177. case 0:
  178. this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest) request,
  179. pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse>(
  180. done));
  181. return;
  182. default:
  183. throw new global::System.InvalidOperationException("Can't get here.");
  184. }
  185. }
  186. public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) {
  187. if (method.Service != Descriptor) {
  188. throw new global::System.ArgumentException(
  189. "Service.GetRequestPrototype() given method descriptor for wrong service type.");
  190. }
  191. switch(method.Index) {
  192. case 0:
  193. return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest.DefaultInstance;
  194. default:
  195. throw new global::System.InvalidOperationException("Can't get here.");
  196. }
  197. }
  198. public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
  199. if (method.Service != Descriptor) {
  200. throw new global::System.ArgumentException(
  201. "Service.GetResponsePrototype() given method descriptor for wrong service type.");
  202. }
  203. switch(method.Index) {
  204. case 0:
  205. return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance;
  206. default:
  207. throw new global::System.InvalidOperationException("Can't get here.");
  208. }
  209. }
  210. public static Stub CreateStub(pb::IRpcChannel channel) {
  211. return new Stub(channel);
  212. }
  213. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  214. public class Stub : global::Google.ProtocolBuffers.TestProtos.TestGenericServiceWithCustomOptions {
  215. internal Stub(pb::IRpcChannel channel) {
  216. this.channel = channel;
  217. }
  218. private readonly pb::IRpcChannel channel;
  219. public pb::IRpcChannel Channel {
  220. get { return channel; }
  221. }
  222. public override void Foo(
  223. pb::IRpcController controller,
  224. global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest request,
  225. global::System.Action<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse> done) {
  226. channel.CallMethod(Descriptor.Methods[0],
  227. controller, request, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance,
  228. pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance));
  229. }
  230. }
  231. }
  232. #endregion
  233. }
  234. #endregion Designer generated code