Esempio n. 1
0
 public void CallMethod(
     pbd::MethodDescriptor method,
     pb::IRpcController controller,
     pb::IMessage request,
     global::System.Action<pb::IMessage> done) {
   if (method.Service != Descriptor) {
     throw new global::System.ArgumentException(
         "Service.CallMethod() given method descriptor for wrong service type.");
   }
   switch(method.Index) {
     case 0:
       this.FindChannel(controller, (global::bnet.protocol.channel.FindChannelRequest) request,
           pb::RpcUtil.SpecializeCallback<global::bnet.protocol.channel.FindChannelResponse>(
           done));
       return;
     case 1:
       this.CreateChannel(controller, (global::bnet.protocol.channel.CreateChannelRequest) request,
           pb::RpcUtil.SpecializeCallback<global::bnet.protocol.channel.CreateChannelResponse>(
           done));
       return;
     case 2:
       this.JoinChannel(controller, (global::bnet.protocol.channel.JoinChannelRequest) request,
           pb::RpcUtil.SpecializeCallback<global::bnet.protocol.channel.JoinChannelResponse>(
           done));
       return;
     default:
       throw new global::System.InvalidOperationException("Can't get here.");
   }
 }
 public void CallMethod(
     pbd::MethodDescriptor method,
     pb::IRpcController controller,
     pb::IMessage request,
     global::System.Action<pb::IMessage> done) {
   if (method.Service != Descriptor) {
     throw new global::System.ArgumentException(
         "Service.CallMethod() given method descriptor for wrong service type.");
   }
   switch(method.Index) {
     case 0:
       this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.FooRequest) request,
           pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse>(
           done));
       return;
     case 1:
       this.Bar(controller, (global::Google.ProtocolBuffers.TestProtos.BarRequest) request,
           pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse>(
           done));
       return;
     default:
       throw new global::System.InvalidOperationException("Can't get here.");
   }
 }
Esempio n. 3
0
 public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
   if (method.Service != Descriptor) {
     throw new global::System.ArgumentException(
         "Service.GetResponsePrototype() given method descriptor for wrong service type.");
   }
   switch(method.Index) {
     case 0:
       return global::bnet.protocol.channel.FindChannelResponse.DefaultInstance;
     case 1:
       return global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance;
     case 2:
       return global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance;
     default:
       throw new global::System.InvalidOperationException("Can't get here.");
   }
 }
 public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
   if (method.Service != Descriptor) {
     throw new global::System.ArgumentException(
         "Service.GetResponsePrototype() given method descriptor for wrong service type.");
   }
   switch(method.Index) {
     case 0:
       return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance;
     default:
       throw new global::System.InvalidOperationException("Can't get here.");
   }
 }