protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters) { if (log.IsDebugEnabled) { log.DebugFormat("OnOperationRequest. Code={0}", operationRequest.OperationCode); } switch (operationRequest.OperationCode) { case (byte)MyOperationCodes.EchoOperation: { // The echo operation one is handled immediately because it does not require the client to join a game. var myEchoRequest = new MyEchoRequest(this.Protocol, operationRequest); if (this.ValidateOperation(myEchoRequest, sendParameters) == false) { return; } var myEchoResponse = new MyEchoResponse { Response = myEchoRequest.Text }; var operationResponse = new OperationResponse(operationRequest.OperationCode, myEchoResponse); this.SendOperationResponse(operationResponse, sendParameters); break; } default: { // for this example all other operations will handled by the base class base.OnOperationRequest(operationRequest, sendParameters); return; } } }
public string MyEcho(string strInput) { MyEchoRequest inValue = new MyEchoRequest(); inValue.strInput = strInput; MyEchoResponse retVal = ((IMyCalls)(this)).MyEcho(inValue); return(retVal.MyEchoResult); }
MyEchoResponse IMyCalls.MyEcho(MyEchoRequest request) { return(base.Channel.MyEcho(request)); }