本文整理汇总了C#中IMessageReceiver.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IMessageReceiver.GetType方法的具体用法?C# IMessageReceiver.GetType怎么用?C# IMessageReceiver.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMessageReceiver
的用法示例。
在下文中一共展示了IMessageReceiver.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubscribeToChannels
/// <summary>
/// Thread safe. Automatically subscribe to all channels specified in class attributes.
/// </summary>
/// <remarks>If an object is subscribed to a channel, it MUST be unsubscribed on destruction.</remarks>
/// <see cref="Sharplike.Core.Game.Unsubscribe"/>
/// <seealso cref="Sharplike.Core.Messaging.ChannelSubscriberAttribute"/>
/// <param name="subscriber">The object to create subscriptions for.</param>
public static void SubscribeToChannels(IMessageReceiver subscriber)
{
foreach (ChannelSubscriberAttribute attr in
Attribute.GetCustomAttributes(subscriber.GetType()))
{
SubscribeToChannel(attr.Channel, subscriber);
}
}
示例2: MessageReceiverStarting
internal void MessageReceiverStarting(IMessageReceiver receiver, MessageHandlerMap map)
{
if (IsEnabled())
MessageReceiverStarting(receiver.GetType().Name, receiver.Path, map.HandlerTypes.Count, map.HandlerTypes.SelectMany(m => m.Value).Count(), Thread.CurrentThread.ManagedThreadId, GetTask());
}
示例3: MessageReceived
internal void MessageReceived(string contentType, IMessageReceiver receiver, string messageId, string correlationId, string sessionId)
{
if (IsEnabled())
MessageReceived(contentType, receiver.GetType().Name, receiver.Path, messageId, correlationId, sessionId, Thread.CurrentThread.ManagedThreadId, GetTask());
}
示例4: MessageReceived
internal void MessageReceived(string contentType, IMessageReceiver receiver, string messageId, string correlationId, string sessionId)
{
if (IsEnabled())
MessageReceived(contentType, receiver.GetType().Name, receiver.Path, messageId, correlationId, sessionId);
}