本文整理汇总了C#中MediaPortal.Common.Messaging.SystemMessage类的典型用法代码示例。如果您正苦于以下问题:C# SystemMessage类的具体用法?C# SystemMessage怎么用?C# SystemMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SystemMessage类属于MediaPortal.Common.Messaging命名空间,在下文中一共展示了SystemMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
}
示例2: SendShareChangedMessage
/// <summary>
/// Sends a message that a share was changed (<see cref="MessageType.ShareChanged"/>).
/// </summary>
/// <param name="share">Share which was changed.</param>
/// <param name="relocationMode">Controls how the data of the changed share should be adapted at the server.</param>
public static void SendShareChangedMessage(Share share, RelocationMode relocationMode)
{
SystemMessage msg = new SystemMessage(MessageType.ShareChanged);
msg.MessageData[SHARE] = share;
msg.MessageData[RELOCATION_MODE] = relocationMode;
ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
}
示例3: SendDialogManagerMessage
public const string DIALOG_RESULT = "DialogResult"; // Type: DialogResult
public static void SendDialogManagerMessage(Guid dialogHandle, DialogResult result)
{
SystemMessage msg = new SystemMessage(MessageType.DialogClosed);
msg.MessageData[DIALOG_HANDLE] = dialogHandle;
msg.MessageData[DIALOG_RESULT] = result;
ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
}
示例4: SendPathChoosenMessage
public const string CHOOSEN_PATH = "ChoosenPath"; // Type: ResourcePath
public static void SendPathChoosenMessage(Guid dialogHandle, ResourcePath choosenPath)
{
SystemMessage msg = new SystemMessage(MessageType.PathChoosen);
msg.MessageData[DIALOG_HANDLE] = dialogHandle;
msg.MessageData[CHOOSEN_PATH] = choosenPath;
ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
}
示例5: Receive
public void Receive(SystemMessage message)
{
if (message.ChannelName == LocalizationMessaging.CHANNEL)
if (((LocalizationMessaging.MessageType) message.MessageType) ==
LocalizationMessaging.MessageType.LanguageChanged)
OnLanguageChanged();
}
示例6: 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;
}
}
}
示例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: SendUpdatePlayerRolesMessage
public static void SendUpdatePlayerRolesMessage(int currentPlayerIndex, int audioPlayerIndex)
{
SystemMessage msg = new SystemMessage(MessageType.UpdatePlayerRolesInternal);
msg.MessageData[CURRENT_PLAYER_INDEX] = currentPlayerIndex;
msg.MessageData[AUDIO_PLAYER_INDEX] = audioPlayerIndex;
ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
}
示例9: SendImportMessage
internal static void SendImportMessage(MessageType messageType, ResourcePath path, ImportJobType importJobType)
{
SystemMessage msg = new SystemMessage(messageType);
msg.MessageData[RESOURCE_PATH] = path;
msg.MessageData[IMPORT_JOB_TYPE] = importJobType;
ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
}
示例10: OnMessageReceived
private void OnMessageReceived(AsynchronousMessageQueue queue, SystemMessage message)
{
if (message.ChannelName == NotificationServiceMessaging.CHANNEL)
Update();
else if (message.ChannelName == WorkflowManagerMessaging.CHANNEL)
Update();
}
示例11: SendTvWishListMessage
public static void SendTvWishListMessage(TvWishListMessaging.MessageType type, string mymessage)
{
// Send Startup Finished Message.
SystemMessage msg = new SystemMessage(type);
msg.MessageData[MESSAGE] = mymessage;
ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
}
示例12: SendSystemStateChangeMessage
public const string NEW_STATE = "NewState"; // Type: SystemState
/// <summary>
/// Sends a <see cref="MessageType.SystemStateChanged"/> message.
/// </summary>
/// <param name="newState">The state the system will switch to.</param>
public static void SendSystemStateChangeMessage(SystemState newState)
{
SystemMessage msg = new SystemMessage(MessageType.SystemStateChanged);
msg.MessageData[NEW_STATE] = newState;
IMessageBroker messageBroker = ServiceRegistration.Get<IMessageBroker>();
if (messageBroker != null)
messageBroker.Send(CHANNEL, msg);
}
示例13: SendSettingsChangeMessage
public const string SETTINGSTYPE = "SettingsType"; // Type: C# Type
/// <summary>
/// Sends a <see cref="MessageType.SettingsChanged"/> message.
/// </summary>
/// <param name="settingsType">The Type of setting that was changed.</param>
public static void SendSettingsChangeMessage(Type settingsType)
{
SystemMessage msg = new SystemMessage(MessageType.SettingsChanged);
msg.MessageData[SETTINGSTYPE] = settingsType;
IMessageBroker messageBroker = ServiceRegistration.Get<IMessageBroker>(false);
if (messageBroker != null)
messageBroker.Send(CHANNEL, msg);
}
示例14: BroadcastWindowsMessage
public const string MESSAGE = "Message"; // Windows message stored as System.Windows.Forms.Message - Take care to copy the message back to the message data after modifying it, else the auto unboxing will prevent applying the new values
public static void BroadcastWindowsMessage(ref Message message)
{
SystemMessage msg = new SystemMessage(MessageType.WindowsBroadcast);
msg.MessageData[MESSAGE] = message;
ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
// Copy message back to the ref message
message = (Message) msg.MessageData[MESSAGE];
}
示例15: messageQueue_MessageReceived
void messageQueue_MessageReceived(AsynchronousMessageQueue queue, SystemMessage message)
{
if (message.ChannelName == ImporterMessaging.Channel)
{
ImporterMessaging.MessageType messageType = (ImporterMessaging.MessageType)message.MessageType;
if (messageType == ImporterMessaging.MessageType.Init)
initImporter();
}
}