本文整理汇总了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;
}
示例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;
}
示例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);
}
}
}
示例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 );
}
示例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 });
}
示例6: NotificationConsumer
public NotificationConsumer(IMessageHandler messageHandler, IChannelWrapper channelWrapper)
{
_messageHandler = messageHandler;
_channelWrapper = channelWrapper;
Listen();
}
示例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;
}
示例8: PollingConsumer
public PollingConsumer(IPollableChannel inputChannel, IMessageHandler handler)
{
AssertUtils.ArgumentNotNull(inputChannel, "inputChannel");
AssertUtils.ArgumentNotNull(handler, "handler");
_inputChannel = inputChannel;
_handler = handler;
}
示例9: MessageClient
public MessageClient(IFramedClient framedClient,
IStacksSerializer packetSerializer,
IMessageHandler messageHandler)
: this(new MessageIdCache(),
framedClient, packetSerializer, messageHandler)
{
}
示例10: Eve
public Eve(IMessageHandler messager)
{
pMessager = messager;
pTimeOut.AutoReset = false;
pTimeOut.Interval = pCommonTimeout;
pTimeOut.Elapsed += PTimeOutElapsed;
}
示例11: PipedRoute
public PipedRoute(IMessageHandler handler, MethodInfo endpoint, string commandName, string[] parameterNames)
{
_commandName = commandName;
_parameterNames = parameterNames;
Handler = handler;
EndPoint = endpoint;
}
示例12: RedisMessageHandlerWorker
public RedisMessageHandlerWorker(
IRedisClientsManager clientsManager, IMessageHandler messageHandler, string queueName,
Action<IMessageHandlerBackgroundWorker, Exception> errorHandler)
: base(messageHandler, queueName, errorHandler)
{
this.clientsManager = clientsManager;
}
示例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;
}
示例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);
}
示例15: MessageItemProcessor
protected MessageItemProcessor(IMessageHandler consumeHandler, IMessageHandler publishHandler,
string publishRoutingKey)
{
ConsumeHandler = consumeHandler;
PublishHandler = publishHandler;
IsActive = true;
PublishRoutingKey = publishRoutingKey;
}