示例#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);
 }
示例#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);
 }
示例#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));
        }
示例#4
0
 public SomeBindWorker(FlowBinder binder)
 {
     binder.Bind <Planet>(1, (Action <Planet>)Console.WriteLine);
 }