ServiceWithNoOuter.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. using pb = global::Google.ProtocolBuffers;
  3. using pbc = global::Google.ProtocolBuffers.Collections;
  4. using pbd = global::Google.ProtocolBuffers.Descriptors;
  5. using scg = global::System.Collections.Generic;
  6. namespace Google.ProtocolBuffers.TestProtos {
  7. public abstract class ServiceWithNoOuter : pb::IService {
  8. public abstract void Foo(
  9. pb::IRpcController controller,
  10. global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter request,
  11. global::System.Action<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> done);
  12. public static pbd::ServiceDescriptor Descriptor {
  13. get { return global::Google.ProtocolBuffers.TestProtos.MultiFileProto.Descriptor.Services[0]; }
  14. }
  15. public pbd::ServiceDescriptor DescriptorForType {
  16. get { return Descriptor; }
  17. }
  18. public void CallMethod(
  19. pbd::MethodDescriptor method,
  20. pb::IRpcController controller,
  21. pb::IMessage request,
  22. global::System.Action<pb::IMessage> done) {
  23. if (method.Service != Descriptor) {
  24. throw new global::System.ArgumentException(
  25. "Service.CallMethod() given method descriptor for wrong " +
  26. "service type.");
  27. }
  28. switch(method.Index) {
  29. case 0:
  30. this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter)request,
  31. pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.TestAllTypes>(
  32. done));
  33. return;
  34. default:
  35. throw new global::System.InvalidOperationException("Can't get here.");
  36. }
  37. }
  38. public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) {
  39. if (method.Service != Descriptor) {
  40. throw new global::System.ArgumentException(
  41. "Service.GetRequestPrototype() given method " +
  42. "descriptor for wrong service type.");
  43. }
  44. switch(method.Index) {
  45. case 0:
  46. return global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter.DefaultInstance;
  47. default:
  48. throw new global::System.ArgumentException("Can't get here.");
  49. }
  50. }
  51. public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
  52. if (method.Service != Descriptor) {
  53. throw new global::System.ArgumentException(
  54. "Service.GetResponsePrototype() given method " +
  55. "descriptor for wrong service type.");
  56. }
  57. switch(method.Index) {
  58. case 0:
  59. return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance;
  60. default:
  61. throw new global::System.ArgumentException("Can't get here.");
  62. }
  63. }
  64. public static Stub CreateStub(
  65. pb::IRpcChannel channel) {
  66. return new Stub(channel);
  67. }
  68. public class Stub : global::Google.ProtocolBuffers.TestProtos.ServiceWithNoOuter {
  69. internal Stub(pb::IRpcChannel channel) {
  70. this.channel = channel;
  71. }
  72. private readonly pb::IRpcChannel channel;
  73. public pb::IRpcChannel Channel {
  74. get { return channel; }
  75. }
  76. public override void Foo(
  77. pb::IRpcController controller,
  78. global::Google.ProtocolBuffers.TestProtos.MessageWithNoOuter request,
  79. global::System.Action<global::Google.ProtocolBuffers.TestProtos.TestAllTypes> done) {
  80. channel.CallMethod(
  81. Descriptor.Methods[0],
  82. controller,
  83. request,
  84. global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance,
  85. pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.TestAllTypes, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder>(done, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance));
  86. }
  87. }
  88. }
  89. }