当前位置: 首页>>代码示例>>C#>>正文


C# IMessageHandler类代码示例

本文整理汇总了C#中IMessageHandler的典型用法代码示例。如果您正苦于以下问题:C# IMessageHandler类的具体用法?C# IMessageHandler怎么用?C# IMessageHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IMessageHandler类属于命名空间,在下文中一共展示了IMessageHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandlerMapping

        public HandlerMapping(string version, string command, IMessageHandler handler)
        {
            if (version == null)
            {
                throw new ArgumentNullException("version");
            }

            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            _catchAll = version == "*";
            _version = _catchAll ? 
            	new string[0] : 
            	#if CF
            	version.Split(new[] { ',' })
            	#else
            	version.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
            	#endif
            	;
            _command = command;
            _handler = handler;
        }
开发者ID:bleissem,项目名称:sharpsnmplib,代码行数:29,代码来源:HandlerMapping.cs

示例2: PriorityBurrowConsumer

        public PriorityBurrowConsumer(IModel channel, IMessageHandler messageHandler, IRabbitWatcher watcher, bool autoAck, int batchSize)
            : base(channel)
        {
            if (channel == null)
            {
                throw new ArgumentNullException("channel");
            }
            if (messageHandler == null)
            {
                throw new ArgumentNullException("messageHandler");
            }
            if (watcher == null)
            {
                throw new ArgumentNullException("watcher");
            }

            if (batchSize < 1)
            {
                throw new ArgumentException("batchSize must be greater than or equal 1", "batchSize");
            }

            Model.ModelShutdown += WhenChannelShutdown;
            Model.BasicRecoverAsync(true);

            _messageHandler = messageHandler;
            _messageHandler.HandlingComplete += MessageHandlerHandlingComplete;
            _watcher = watcher;
            _autoAck = autoAck;
            _batchSize = batchSize;
        }
开发者ID:joefeser,项目名称:Burrow.NET,代码行数:30,代码来源:PriorityBurrowConsumer.cs

示例3: RegisterHandler

        public static void RegisterHandler(Type type, IMessageHandler handlerObject)
        {
            lock (syncObj)
            {
                if (handlers.ContainsKey(type))
                {
                    //Console.WriteLine("Type found - checking handlers list");
                    LinkedList<IMessageHandler> typeHandlers = handlers[type];
                    if (typeHandlers == null) // для этого типа раньше не регистрировались подписчики
                    {
                        typeHandlers = new LinkedList<IMessageHandler>();
                    }

                    // WARNING: linear search
                    if (!typeHandlers.Contains(handlerObject)) // для этого типа и этого объекта не назначен этот же объект-обработчик
                        typeHandlers.AddLast(handlerObject);
                }
                else
                {
                    //Console.WriteLine("Type not found - creating handlers list");
                    handlers.Add(type, new LinkedList<IMessageHandler>());
                    handlers[type].AddLast(handlerObject);
                }
            }
        }
开发者ID:Skybladev2,项目名称:Sea-battles,代码行数:25,代码来源:MessageDispatcher.cs

示例4: UserRtsController

        /// <summary>
        /// Creates this controller
        /// </summary>
        /// <param name="user">Command user that this controller listens to</param>
        /// <param name="actionTarget">Entity actions are sent to this object</param>
        public UserRtsController( CommandUser user, IMessageHandler actionTarget )
        {
            m_Target = actionTarget;

            CommandList entityCommandList = CommandListManager.Instance.FindOrCreateFromEnum( typeof( EntityCommands ) );
            user.AddActiveListener( entityCommandList, OnCommandActive );
        }
开发者ID:johann-gambolputty,项目名称:robotbastards,代码行数:12,代码来源:UserRtsController.cs

示例5: Invoke

        public override void Invoke(Type msgType, IMessage message, IMessageHandler handler)
        {
            // PERF: cache or create compiled Lambda to invoke this
            var method = handler.GetType().GetMethod("Handle", new[] { msgType });

            method.Invoke(handler, new object[] { message });
        }
开发者ID:zhoufoxcn,项目名称:Castle.RabbitMq,代码行数:7,代码来源:DefaultMessageHandlerInvoker.cs

示例6: NotificationConsumer

        public NotificationConsumer(IMessageHandler messageHandler, IChannelWrapper channelWrapper)
        {
            _messageHandler = messageHandler;
            _channelWrapper = channelWrapper;

            Listen();
        }
开发者ID:cybyvlad,项目名称:Threadtail,代码行数:7,代码来源:NotificationConsumer.cs

示例7: BlockUserTask

 public BlockUserTask(IMessageHandler consumeHandler, IMessageHandler publishHandler, string publishRoutingKey, IFeedBackDataManager feedBackManager, IAccountManager accountManager, IBlackListDataManager blackListDataManager)
     : base(consumeHandler, publishHandler, publishRoutingKey)
 {
     _feedBackManager = feedBackManager;
     _accountManager = accountManager;
     _blackListDataManager = blackListDataManager;
 }
开发者ID:TokleMahesh,项目名称:BG,代码行数:7,代码来源:BlockUserTask.cs

示例8: PollingConsumer

 public PollingConsumer(IPollableChannel inputChannel, IMessageHandler handler)
 {
     AssertUtils.ArgumentNotNull(inputChannel, "inputChannel");
     AssertUtils.ArgumentNotNull(handler, "handler");
     _inputChannel = inputChannel;
     _handler = handler;
 }
开发者ID:rlxrlxrlx,项目名称:spring-net-integration,代码行数:7,代码来源:PollingConsumer.cs

示例9: MessageClient

 public MessageClient(IFramedClient framedClient, 
                      IStacksSerializer packetSerializer,
                      IMessageHandler messageHandler)
     : this(new MessageIdCache(),
            framedClient, packetSerializer, messageHandler)
 {
 }
开发者ID:wushian,项目名称:Stacks,代码行数:7,代码来源:MessageClient.cs

示例10: Eve

 public Eve(IMessageHandler messager)
 {
     pMessager = messager;
     pTimeOut.AutoReset = false;
     pTimeOut.Interval = pCommonTimeout;
     pTimeOut.Elapsed += PTimeOutElapsed;
 }
开发者ID:antgraf,项目名称:BaEveCourier,代码行数:7,代码来源:Eve.Public.cs

示例11: PipedRoute

 public PipedRoute(IMessageHandler handler, MethodInfo endpoint, string commandName, string[] parameterNames)
 {
     _commandName = commandName;
     _parameterNames = parameterNames;
     Handler = handler;
     EndPoint = endpoint;
 }
开发者ID:rjt011000,项目名称:NBot,代码行数:7,代码来源:PipedRoute.cs

示例12: RedisMessageHandlerWorker

 public RedisMessageHandlerWorker(
     IRedisClientsManager clientsManager, IMessageHandler messageHandler, string queueName,
     Action<IMessageHandlerBackgroundWorker, Exception> errorHandler)
     : base(messageHandler, queueName, errorHandler)
 {
     this.clientsManager = clientsManager;
 }
开发者ID:adam-26,项目名称:ServiceStack.Redis,代码行数:7,代码来源:RedisMessageHandlerWorker.cs

示例13: EventDrivenConsumer

 public EventDrivenConsumer(ISubscribableChannel inputChannel, IMessageHandler handler)
 {
     AssertUtils.ArgumentNotNull(inputChannel, "inputChannel must not be null");
     AssertUtils.ArgumentNotNull(handler, "handler must not be null");
     _inputChannel = inputChannel;
     _handler = handler;
 }
开发者ID:rlxrlxrlx,项目名称:spring-net-integration,代码行数:7,代码来源:EventDrivenConsumer.cs

示例14: Initialize

        //        1. List<pos + DateTime (class)> // högre och högre tid på olika pos
        //        2. bild i ps, rita cirklar dra streck mellan dom..
        //        3. bygga på med vinklar (sist, till att börja med kör vi med position)
        public override void Initialize(GameContext context)
        {
            base.Initialize(context);

            snapShots = new List<Snapshot>();
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(0), new Vector2(487.0f, 585.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(3), new Vector2(510.0f, 200.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(7), new Vector2(775.0f, 326.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(10), new Vector2(1142.0f, 103.0f)));

            this.spriteBatch = spriteBatch ?? new SpriteBatch(Context.Graphics.Device);

            time = "";
            interpolate = new Vector2();

            gameServer = ServiceLocator.Get<IGameServer>();
            gameClient = ServiceLocator.Get<IGameClient>();
            messageHandler = ServiceLocator.Get<IMessageHandler>();

            // Create the connection between the client and server
            gameServer.Start();
            gameClient.Connect();

            //sendTimer = new GameTimer(TimeSpan.FromMilliseconds(1000 / 20), SendClientSpatial);

            Context.Input.Keyboard.ClearMappings();
            Context.Input.Keyboard.AddMapping(Keys.F1);
            Context.Input.Keyboard.AddMapping(Keys.F2);
            Context.Input.Keyboard.AddMapping(Keys.F3);
        }
开发者ID:JohanGl,项目名称:Outworld-XNA,代码行数:33,代码来源:NetworkScene.cs

示例15: MessageItemProcessor

 protected MessageItemProcessor(IMessageHandler consumeHandler, IMessageHandler publishHandler,
                                string publishRoutingKey)
 {
     ConsumeHandler = consumeHandler;
     PublishHandler = publishHandler;
     IsActive = true;
     PublishRoutingKey = publishRoutingKey;
 }
开发者ID:TokleMahesh,项目名称:BG,代码行数:8,代码来源:MessageItemProcessor.cs


注:本文中的IMessageHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。