Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 public SomeBindWorker(FlowBinder binder)
 {
     binder.Bind <Planet>(1, (Action <Planet>)Console.WriteLine);
 }