本文整理汇总了C#中MediaPortal.Common.Messaging.AsynchronousMessageQueue类的典型用法代码示例。如果您正苦于以下问题:C# AsynchronousMessageQueue类的具体用法?C# AsynchronousMessageQueue怎么用?C# AsynchronousMessageQueue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AsynchronousMessageQueue类属于MediaPortal.Common.Messaging命名空间,在下文中一共展示了AsynchronousMessageQueue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MessageWatcher
public MessageWatcher(object owner, string messageChannel, MessageHandlerDlgt handler, bool autoDispose)
{
_handler = handler;
_autoDispose = autoDispose;
_messageQueue = new AsynchronousMessageQueue(owner, new string[] {messageChannel});
_messageQueue.MessageReceived += OnMessageReceived;
}
示例2: OnMessageReceived
protected void OnMessageReceived(AsynchronousMessageQueue queue, SystemMessage message)
{
if (message.ChannelName == ServerConnectionMessaging.CHANNEL)
{
ServerConnectionMessaging.MessageType messageType =
(ServerConnectionMessaging.MessageType) message.MessageType;
switch (messageType)
{
case ServerConnectionMessaging.MessageType.HomeServerAttached:
case ServerConnectionMessaging.MessageType.HomeServerDetached:
FireStateChanged();
break;
}
}
else if (message.ChannelName == SharesMessaging.CHANNEL)
{
SharesMessaging.MessageType messageType =
(SharesMessaging.MessageType) message.MessageType;
switch (messageType)
{
case SharesMessaging.MessageType.ShareAdded:
case SharesMessaging.MessageType.ShareRemoved:
FireStateChanged();
break;
}
}
}
示例3: Create
public static ShutdownWatcher Create(AsynchronousMessageQueue owner)
{
IMessageBroker broker = ServiceRegistration.Get<IMessageBroker>();
ShutdownWatcher result = new ShutdownWatcher(owner);
broker.RegisterMessageReceiver(SystemMessaging.CHANNEL, result);
return result;
}
示例4: Activated
public void Activated(PluginRuntime pluginRuntime)
{
messageQueue = new AsynchronousMessageQueue(this,
new string[] {SystemMessaging.CHANNEL, PlayerManagerMessaging.CHANNEL});
messageQueue.MessageReceived += OnMessageReceived;
messageQueue.Start();
}
示例5: OnMessageReceived
void OnMessageReceived(AsynchronousMessageQueue queue, SystemMessage message)
{
if (message.ChannelName == PlayerManagerMessaging.CHANNEL)
{
PlayerManagerMessaging.MessageType messageType = (PlayerManagerMessaging.MessageType) message.MessageType;
switch (messageType)
{
case PlayerManagerMessaging.MessageType.PlayerStarted:
case PlayerManagerMessaging.MessageType.PlayerStopped:
case PlayerManagerMessaging.MessageType.PlayerEnded:
Update();
break;
}
}
else if (message.ChannelName == PlayerContextManagerMessaging.CHANNEL)
{
PlayerContextManagerMessaging.MessageType messageType = (PlayerContextManagerMessaging.MessageType) message.MessageType;
switch (messageType)
{
case PlayerContextManagerMessaging.MessageType.CurrentPlayerChanged:
Update();
break;
}
}
else if (message.ChannelName == WorkflowManagerMessaging.CHANNEL)
{
WorkflowManagerMessaging.MessageType messageType = (WorkflowManagerMessaging.MessageType) message.MessageType;
switch (messageType)
{
case WorkflowManagerMessaging.MessageType.NavigationComplete:
Update();
break;
}
}
}
示例6: OnMessageReceived
private void OnMessageReceived(AsynchronousMessageQueue queue, SystemMessage message)
{
if (message.ChannelName == NotificationServiceMessaging.CHANNEL)
Update();
else if (message.ChannelName == WorkflowManagerMessaging.CHANNEL)
Update();
}
示例7: OnMessageReceived
private void OnMessageReceived(AsynchronousMessageQueue queue, SystemMessage message)
{
if (message.ChannelName == PlayerManagerMessaging.CHANNEL)
{
PlayerManagerMessaging.MessageType messageType = (PlayerManagerMessaging.MessageType) message.MessageType;
switch (messageType)
{
case PlayerManagerMessaging.MessageType.PlayerStarted:
case PlayerManagerMessaging.MessageType.PlayerStopped:
case PlayerManagerMessaging.MessageType.PlayerEnded:
HandlePlayerChange();
break;
case PlayerManagerMessaging.MessageType.PlaybackStateChanged:
HandlePlaybackStateChanged();
break;
}
}
else if (message.ChannelName == PlayerContextManagerMessaging.CHANNEL)
{
PlayerContextManagerMessaging.MessageType messageType = (PlayerContextManagerMessaging.MessageType) message.MessageType;
switch (messageType)
{
case PlayerContextManagerMessaging.MessageType.PlayerSlotsChanged:
HandlePlayerChange();
break;
}
}
}
示例8: Activated
public void Activated(PluginRuntime pluginRuntime)
{
if (_isInitialized)
return;
_isInitialized = true;
// All non-default media item aspects must be registered
var miatr = ServiceRegistration.Get<IMediaItemAspectTypeRegistration>();
miatr.RegisterLocallyKnownMediaItemAspectType(OnlineVideosAspect.Metadata);
InitializeOnlineVideoSettings();
// create a message queue for OnlineVideos to broadcast that the list of site utils was rebuild
_messageQueue = new AsynchronousMessageQueue(this, new string[] { OnlineVideosMessaging.CHANNEL });
_messageQueue.Start();
// load and update sites in a background thread, it takes time and we are on the Main thread delaying MP2 startup
ServiceRegistration.Get<IThreadPool>().Add(
InitialSitesUpdateAndLoad,
"OnlineVideos Initial Sites Load & Update",
QueuePriority.Low,
ThreadPriority.BelowNormal,
AfterInitialLoad);
}
示例9: ImporterModel
public ImporterModel()
{
_statusProperty = new WProperty(typeof(string), null);
_progressProperty = new WProperty(typeof(int), 0);
messageQueue = new AsynchronousMessageQueue(this, new[] { ImporterMessaging.Channel });
messageQueue.MessageReceived += messageQueue_MessageReceived;
}
示例10: SubscribeToMessages
void SubscribeToMessages()
{
_messageQueue = new AsynchronousMessageQueue(this, new string[]
{
ServerConnectionMessaging.CHANNEL
});
_messageQueue.MessageReceived += OnMessageReceived;
_messageQueue.Start();
}
示例11: Install
public void Install()
{
_messageQueue = new AsynchronousMessageQueue(this, new string[]
{
ServerConnectionMessaging.CHANNEL
});
_messageQueue.MessageReceived += OnMessageReceived;
_messageQueue.Start();
}
示例12: SubscribeToMessages
private void SubscribeToMessages()
{
_messageQueue = new AsynchronousMessageQueue(this, new string[]
{
ContentDirectoryMessaging.CHANNEL
});
_messageQueue.MessageReceived += OnMessageReceived;
_messageQueue.Start();
}
示例13: SubscribeToMessages
void SubscribeToMessages()
{
_messageQueue = new AsynchronousMessageQueue(this, new string[]
{
RemovableMediaMessaging.CHANNEL
});
_messageQueue.MessageReceived += OnMessageReceived;
_messageQueue.Start();
}
示例14: SubscribeToMessages
void SubscribeToMessages()
{
_messageQueue = new AsynchronousMessageQueue(this, new string[]
{
PlayerManagerMessaging.CHANNEL
});
_messageQueue.MessageReceived += OnMessageReceived;
_messageQueue.Start();
}
示例15: CommonNotificationService
public CommonNotificationService()
{
_messageQueue = new AsynchronousMessageQueue(this, new string[]
{
ImporterWorkerMessaging.CHANNEL,
});
_messageQueue.MessageReceived += OnMessageReceived;
_messageQueue.Start();
}