public void Bind <T>(int serverClientId, Action <T> handler) { if (serverClientId < 0) { throw new Exception("Negative ids are reserved for SocketFlow"); } flowBinder.Bind <T>(serverClientId, handler); }
public void Bind <T>(int clientServerId, Action <DestinationClient, T> handler) { if (clientServerId < 0) { throw new Exception("Negative ids are reserved for SocketFlow"); } flowBinder.Bind <T>(clientServerId, handler); }
public void Bind_NoWrapper_BindShouldBeBindActionTwiceAndMore() { Action <Planet> action = Console.WriteLine; var wrapper = new JsonDataWrapper <Planet>(); binder.Using(wrapper); Assert.DoesNotThrow(() => binder.Bind <Planet>(1, action)); Assert.DoesNotThrow(() => binder.Bind <Planet>(1, (Action)TestActionForThisContext)); Assert.DoesNotThrow(() => binder.Bind <Planet>(1, action)); Assert.DoesNotThrow(() => binder.Bind <Planet>(1, (Action)TestActionForThisContext)); }
public SomeBindWorker(FlowBinder binder) { binder.Bind <Planet>(1, (Action <Planet>)Console.WriteLine); }