本文整理汇总了C#中MediaPortal.GUI.Library.GUIMessage.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# GUIMessage.GetType方法的具体用法?C# GUIMessage.GetType怎么用?C# GUIMessage.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPortal.GUI.Library.GUIMessage
的用法示例。
在下文中一共展示了GUIMessage.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMessage
public override bool OnMessage(GUIMessage message)
{
switch (message.Message)
{
case GUIMessage.MessageType.GUI_MSG_VIDEODATABASE_REFRESH:
try
{
currentSelectedItem = facadeLayout.SelectedListItemIndex;
if (currentSelectedItem > 0)
{
currentSelectedItem--;
}
LoadDirectory(currentFolder);
if (currentSelectedItem >= 0)
{
GUIControl.SelectItemControl(GetID, facadeLayout.GetID, currentSelectedItem);
}
}
catch (Exception ex)
{
Log.Error("GUIVideoFiles error: On message: {0} - {1}", message.GetType(), ex.Message);
}
break;
case GUIMessage.MessageType.GUI_MSG_VIDEOFILE_CREATED:
// Is new file in scanshare??
if (message.Param2 > 0)
{
// To do
}
break;
case GUIMessage.MessageType.GUI_MSG_VIDEODIRECTORY_CREATED:
// Is new directory in scanshare??
if (message.Param2 > 0)
{
// To do
}
break;
}
return base.OnMessage(message);
}
示例2: OnMessage
public override bool OnMessage(GUIMessage message)
{
switch (message.Message)
{
case GUIMessage.MessageType.GUI_MSG_CD_REMOVED:
if (g_Player.Playing && g_Player.IsDVD &&
message.Label.Equals(g_Player.CurrentFile.Substring(0, 2), StringComparison.InvariantCultureIgnoreCase))
// test if it is our drive
{
Log.Info("GUIVideoFiles: Stop dvd since DVD is ejected");
g_Player.Stop();
}
if (GUIWindowManager.ActiveWindow == GetID)
{
if (Util.Utils.IsDVD(_currentFolder))
{
_currentFolder = string.Empty;
LoadDirectory(_currentFolder, false);
}
}
break;
case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADING:
facadeLayout.OnMessage(message);
break;
case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADED:
facadeLayout.OnMessage(message);
break;
case GUIMessage.MessageType.GUI_MSG_SHOW_DIRECTORY:
// Make sure file view is the current window
if (VideoState.StartWindow != GetID)
{
VideoState.StartWindow = GetID;
Reset();
GUIWindowManager.ReplaceWindow(GetID);
}
_currentFolder = message.Label;
LoadDirectory(_currentFolder, true);
break;
case GUIMessage.MessageType.GUI_MSG_ADD_REMOVABLE_DRIVE:
if (_switchRemovableDrives)
{
_currentFolder = message.Label;
if (!Util.Utils.IsRemovable(message.Label))
{
_virtualDirectory.AddRemovableDrive(message.Label, message.Label2);
}
}
LoadDirectory(_currentFolder, false);
break;
case GUIMessage.MessageType.GUI_MSG_REMOVE_REMOVABLE_DRIVE:
if (!Util.Utils.IsRemovable(message.Label))
{
_virtualDirectory.Remove(message.Label);
}
if (_currentFolder.Contains(message.Label))
{
_currentFolder = string.Empty;
}
LoadDirectory(_currentFolder, false);
break;
case GUIMessage.MessageType.GUI_MSG_VOLUME_INSERTED:
case GUIMessage.MessageType.GUI_MSG_VOLUME_REMOVED:
if (_currentFolder == string.Empty || _currentFolder.Substring(0, 2) == message.Label)
{
_currentFolder = string.Empty;
LoadDirectory(_currentFolder, false);
}
break;
case GUIMessage.MessageType.GUI_MSG_PLAY_DVD:
OnPlayDVD(message.Label, GetID);
break;
case GUIMessage.MessageType.GUI_MSG_VIDEODIRECTORY_REFRESH:
string changedFileDirectory = message.Object.ToString();
if (changedFileDirectory == _currentFolder)
{
try
{
_history.Set(facadeLayout.SelectedListItemIndex.ToString(), _currentFolder);
LoadDirectory(_currentFolder, false);
}
catch (Exception ex)
{
Log.Error("GUIVideoFiles error: On message: {0} - {1}", message.GetType(), ex.Message);
}
}
break;
case GUIMessage.MessageType.GUI_MSG_VIDEOFILE_DELETED:
try
//.........这里部分代码省略.........