public void GetHandler_OneWrapper_ShouldBeReturnCorrectHandlerMethod() { Action <Planet> action = Console.WriteLine; var wrapper = new JsonDataWrapper <Planet>(); binder.Using(wrapper); binder.Bind <Planet>(1, action); var actualHandlerInfo = binder.GetHandler(1); Assert.AreEqual(action.Method, actualHandlerInfo.Method); }
private void Protocol_OnData(int serverClientId, byte[] data) { var handler = flowBinder.GetHandler(serverClientId); handler.Method.Invoke(handler.Target, new[] { flowBinder.GetWrapper(serverClientId).DataWrapper.FormatRaw(data) }); }
internal void ReceivedData(DestinationClient client, int clientServerId, byte[] data) { var wrapper = flowBinder.GetWrapper(clientServerId); var handler = flowBinder.GetHandler(clientServerId); handler.Method.Invoke(handler.Target, new[] { client, wrapper.DataWrapper.FormatRaw(data) }); }