当前位置: 首页>>代码示例>>C#>>正文


C# GUIMessage.GetType方法代码示例

本文整理汇总了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);
    }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:45,代码来源:GUIVideoTitle.cs

示例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
//.........这里部分代码省略.........
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:101,代码来源:GUIVideoFiles.cs


注:本文中的MediaPortal.GUI.Library.GUIMessage.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。