コード例 #1
0
        public SettingList Get(SettingKeyList value)
        {
            var call = new global::ClosetRpc.RpcCallParameters();

            call.ServiceName = SettingsService_Proxy.ServiceName;
            call.MethodName  = "Get";
            call.CallData    = value.ToByteArray();
            var result = this.client.CallService(call);

            if (result.Status != global::ClosetRpc.RpcStatus.Succeeded)
            {
                throw new Exception(); // TODO: Be more specific
            }

            var returnValue = new SettingList();

            returnValue.MergeFrom(result.ResultData);
            return(returnValue);
        }
コード例 #2
0
        public void CallMethod(global::ClosetRpc.IServerContext context, global::ClosetRpc.IRpcCall rpcCall, global::ClosetRpc.IRpcResult rpcResult)
        {
            rpcResult.Status = global::ClosetRpc.RpcStatus.Succeeded;

            if (rpcCall.MethodName == "Get")
            {
                var input = new SettingKeyList();
                input.MergeFrom(new CodedInputStream(rpcCall.CallData));
                var result = this.Impl.Get(context, input);
                rpcResult.ResultData = result.ToByteArray();
            }
            else if (rpcCall.MethodName == "Set")
            {
                var input = new SettingList();
                input.MergeFrom(new CodedInputStream(rpcCall.CallData));
                this.Impl.Set(context, input);
            }
            else
            {
                rpcResult.Status = global::ClosetRpc.RpcStatus.UnknownMethod;
            }

            // TODO: Generate an exception handling code.
        }
コード例 #3
0
 public abstract SettingList Get(global::ClosetRpc.IServerContext context, SettingKeyList value);