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


C# GUIMessage类代码示例

本文整理汇总了C#中GUIMessage的典型用法代码示例。如果您正苦于以下问题:C# GUIMessage类的具体用法?C# GUIMessage怎么用?C# GUIMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GUIMessage类属于命名空间,在下文中一共展示了GUIMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WndProc

  /// <summary>
  /// Message Pump
  /// </summary>
  /// <param name="msg"></param>
  protected override void WndProc(ref Message msg)
  {
    try
    {
      switch (msg.Msg)
      {
        case (int)ShellNotifications.WmShnotify:
          NotifyInfos info = new NotifyInfos((ShellNotifications.SHCNE)(int)msg.LParam);
          
          if (Notifications.NotificationReceipt(msg.WParam, msg.LParam, ref info))
          {
            if (info.Notification == ShellNotifications.SHCNE.SHCNE_MEDIAINSERTED)
            {
              string path = info.Item1;

              if (Utils.IsRemovable(path))
              {
                string driveName = Utils.GetDriveName(info.Item1);
                GUIMessage gmsg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ADD_REMOVABLE_DRIVE, 0, 0, 0, 0, 0, 0);
                gmsg.Label = info.Item1;
                gmsg.Label2 = String.Format("({0}) {1}", path, driveName);
                GUIGraphicsContext.SendMessage(gmsg);
              }
            }

            if (info.Notification == ShellNotifications.SHCNE.SHCNE_MEDIAREMOVED)
            {
              string path = info.Item1;

              if (Utils.IsRemovable(path))
              {
                string driveName = Utils.GetDriveName(info.Item1);
                GUIMessage gmsg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_REMOVE_REMOVABLE_DRIVE, 0, 0, 0, 0, 0, 0);
                gmsg.Label = info.Item1;
                gmsg.Label2 = String.Format("({0}) {1}", path, driveName);
                GUIGraphicsContext.SendMessage(gmsg);
              }
            }
          }
          return;

        // power management
        case WM_POWERBROADCAST:
          OnPowerBroadcast(ref msg);
          break;

        // set maximum and minimum form size in windowed mode
        case WM_GETMINMAXINFO:
          OnGetMinMaxInfo(ref msg);
          PluginManager.WndProc(ref msg);
          break;

        case WM_ENTERSIZEMOVE:
          Log.Debug("Main: WM_ENTERSIZEMOVE");
          PluginManager.WndProc(ref msg);
          break;

        case WM_EXITSIZEMOVE:
          Log.Debug("Main: WM_EXITSIZEMOVE");
          PluginManager.WndProc(ref msg);
          break;

        // only allow window to be moved inside a valid working area
        case WM_MOVING:
          OnMoving(ref msg);
          PluginManager.WndProc(ref msg);
          break;
        
        // verify window size in case it was not resized by the user
        case WM_SIZE:
          OnSize(ref msg);
          PluginManager.WndProc(ref msg);
          break;

        // aspect ratio save window resizing
        case WM_SIZING:
          OnSizing(ref msg);
          PluginManager.WndProc(ref msg);
          break;
        
        // handle display changes
        case WM_DISPLAYCHANGE:
          OnDisplayChange(ref msg);
          PluginManager.WndProc(ref msg);
          break;
        
        // handle device changes
        case WM_DEVICECHANGE:
          OnDeviceChange(ref msg);
          PluginManager.WndProc(ref msg);
          break;

        case WM_QUERYENDSESSION:
          Log.Debug("Main: WM_QUERYENDSESSION");
          PluginManager.WndProc(ref msg);
          base.WndProc(ref msg);
//.........这里部分代码省略.........
开发者ID:Eddie-Jee,项目名称:MediaPortal-1,代码行数:101,代码来源:MediaPortal.cs

示例2: AddMessage

 public void AddMessage(string text,Vector3 worldPoint, MessageType type )
 {
     GUIMessage message = new GUIMessage();
     message.destroyTime = Time.time + messageDelay;
     message.text = text;
     message.worldPoint = worldPoint;
     message.type = type;
     guiMessages.Enqueue(message);
 }
开发者ID:kostya05,项目名称:TPS-Proto-Unity,代码行数:9,代码来源:PlayerMainGui.cs

示例3: OnMessage

  private void OnMessage(GUIMessage message)
  {
    if (_suspended)
    {
      return;
    }
    switch (message.Message)
    {
      case GUIMessage.MessageType.GUI_MSG_RESTART_REMOTE_CONTROLS:
        Log.Info("Main: Restart remote controls");
        InputDevices.Stop();
        InputDevices.Init();
        break;

      case GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW:
        GUIWindowManager.ActivateWindow(message.Param1);
        if (GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_TVFULLSCREEN ||
            GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_FULLSCREEN_TELETEXT ||
            GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO ||
            GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_FULLSCREEN_MUSIC)
        {
          GUIGraphicsContext.IsFullScreenVideo = true;
        }
        else
        {
          GUIGraphicsContext.IsFullScreenVideo = false;
        }
        break;

      case GUIMessage.MessageType.GUI_MSG_CD_INSERTED:
        AutoPlay.ExamineCD(message.Label);
        break;

      case GUIMessage.MessageType.GUI_MSG_VOLUME_INSERTED:
        AutoPlay.ExamineVolume(message.Label);
        break;

      case GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL:
        bool bIsInteger;
        double retNum;
        bIsInteger =
          Double.TryParse(message.Label, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out retNum);
        try
        {
          if (bIsInteger)
          {
            usbuirtdevice.ChangeTunerChannel(message.Label);
          }
        }
        catch (Exception) {}
        try
        {
          winlircdevice.ChangeTunerChannel(message.Label);
        }
        catch (Exception) {}
        try
        {
          if (bIsInteger)
          {
            redeyedevice.ChangeTunerChannel(message.Label);
          }
        }
        catch (Exception) {}
        break;

      case GUIMessage.MessageType.GUI_MSG_SWITCH_FULL_WINDOWED:
        if (GUIGraphicsContext.IsDirectX9ExUsed() && useEnhancedVideoRenderer)
        {
          return;
        }
        bool fullscreen = (message.Param1 != 0);
        Log.Debug("Main: Received DX exclusive mode switch message. Fullscreen && maximized == {0}",
                  fullscreen && isMaximized);
        if (isMaximized == false || GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.STOPPING)
        {
          return;
        }
        if (fullscreen)
        {
          //switch to fullscreen mode
          Log.Debug("Main: Goto fullscreen: {0}", GUIGraphicsContext.DX9Device.PresentationParameters.Windowed);
          if (GUIGraphicsContext.DX9Device.PresentationParameters.Windowed)
          {
            SwitchFullScreenOrWindowed(false);
          }
        }
        else
        {
          //switch to windowed mode
          Log.Debug("Main: Goto windowed mode: {0}",
                    GUIGraphicsContext.DX9Device.PresentationParameters.Windowed);
          if (!GUIGraphicsContext.DX9Device.PresentationParameters.Windowed)
          {
            SwitchFullScreenOrWindowed(true);
          }
        }
        // Must set the FVF after reset
        GUIFontManager.SetDevice();
        break;

//.........这里部分代码省略.........
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:101,代码来源:MediaPortal.cs

示例4: CheckForNewUpdate

 private void CheckForNewUpdate()
 {
   if (!m_bNewVersionAvailable) return;
   if (GUIWindowManager.IsRouted) return;
   g_Player.Stop();
   GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ASKYESNO,0,0,0,0,0,0);
   msg.Param1=709;
   msg.Param2=710;
   msg.Param3=0;
   GUIWindowManager.SendMessage(msg);
   if (msg.Param1==0) 
   {
     Log.Info("Main: Update - User canceled download");
     m_bCancelVersion = true;
     m_bNewVersionAvailable = false;
     return;
   }
   m_bCancelVersion = false;
   m_bNewVersionAvailable = false;
 }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:20,代码来源:MediaPortal.cs

示例5: OnMessage

 public override bool OnMessage(GUIMessage message)
 {
   bool result = base.OnMessage(message);
   if (message.Message == GUIMessage.MessageType.GUI_MSG_ITEM_SELECT)
   {
     UpdateUpDownControls();
   }
   return result;
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:9,代码来源:GUIUpDownListControl.cs

示例6: Main


//.........这里部分代码省略.........
        }

        // log information about available adapters
        var enumeration = new D3DEnumeration();
        enumeration.Enumerate();
        foreach (GraphicsAdapterInfo ai in enumeration.AdapterInfoList)
        {
          Log.Debug("Adapter #{0}: {1} - Driver: {2} ({3}) - DeviceName: {4}",
            ai.AdapterOrdinal, ai.AdapterDetails.Description, ai.AdapterDetails.DriverName, ai.AdapterDetails.DriverVersion, ai.AdapterDetails.DeviceName);
        }

        // Localization strings for new splash screen and for MediaPortal itself
        LoadLanguageString();

        // Initialize the skin and theme prior to beginning the splash screen thread.  This provides for the splash screen to be used in a theme.
        string skin;
        try
        {
          using (Settings xmlreader = new MPSettings())
          {
            skin = string.IsNullOrEmpty(SkinOverride) ? xmlreader.GetValueAsString("skin", "name", "Default") : SkinOverride;
          }
        }
        catch (Exception)
        {
           skin = "Default";
        }

        Config.SkinName = skin;
        GUIGraphicsContext.Skin = skin;
        SkinSettings.Load();

        // Send a message that the skin has changed.
        var msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SKIN_CHANGED, 0, 0, 0, 0, 0, null);
        GUIGraphicsContext.SendMessage(msg);

        Log.Info("Main: Skin is {0} using theme {1}", skin, GUIThemeManager.CurrentTheme);

        // Start Splash Screen
        string version = ConfigurationManager.AppSettings["version"];
        SplashScreen = new SplashScreen {Version = version};

        #if !DEBUG
        SplashScreen.Run();
        #endif

        Application.DoEvents(); // process message queue
        
        if (_waitForTvServer)
        {
          Log.Debug("Main: Wait for TV service requested");
          ServiceController ctrl;
          try
          {
            ctrl = new ServiceController("TVService");
          }
          catch (Exception)
          {
            ctrl = null;
            Log.Debug("Main: Create ServiceController for TV service failed - proceeding...");
          }

          if (ctrl != null)
          {
            //Sanity check for existance of TV service
            ServiceControllerStatus status = ServiceControllerStatus.Stopped;
开发者ID:GhoSe-OSS,项目名称:MonoTV,代码行数:67,代码来源:MediaPortal.cs

示例7: PromptUserBeforeChangingPowermode

  /// <summary>
  /// 
  /// </summary>
  /// <param name="action"></param>
  /// <returns></returns>
  private static bool PromptUserBeforeChangingPowermode(Action action)
  {
    var msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ASKYESNO, 0, 0, 0, 0, 0, 0);
    switch (action.wID)
    {
      case Action.ActionType.ACTION_REBOOT:
        msg.Param1 = 630;
        break;

      case Action.ActionType.ACTION_POWER_OFF:
        msg.Param1 = 1600;
        break;

      case Action.ActionType.ACTION_SUSPEND:
        msg.Param1 = 1601;
        break;

      case Action.ActionType.ACTION_HIBERNATE:
        msg.Param1 = 1602;
        break;
    }
    msg.Param2 = 0;
    msg.Param3 = 0;
    GUIWindowManager.SendMessage(msg);

    return (msg.Param1 == 1);
  }
开发者ID:GhoSe-OSS,项目名称:MonoTV,代码行数:32,代码来源:MediaPortal.cs

示例8: OnMouseMove

 protected override void OnMouseMove(int cx, int cy, Action action)
 {
   for (int i = Children.Count - 1; i >= 0; i--)
   {
     GUIControl control = (GUIControl)Children[i];
     bool bFocus;
     int controlID;
     if (control.HitTest(cx, cy, out controlID, out bFocus))
     {
       if (!bFocus)
       {
         GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SETFOCUS, GetID, 0, controlID, 0, 0, null);
         OnMessage(msg);
         control.HitTest(cx, cy, out controlID, out bFocus);
       }
       control.OnAction(action);
       return;
     }
     else
     {
       // no control selected
       control.Focus = false;
     }
   }
   Focused = false;
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:26,代码来源:GUIOverlayWindow.cs

示例9: Start

    void Start()
    {
        cm = GameObject.Find("MainCamera").GetComponent<CameraManager>();

        menuWidth = 200;
        rightOffset = 5;
        topOffset = 5;
        menuButtonHeight = 40;
        smallButtonHeight = 20;

        fractalNatureFlag = true;
        generalSettingsFlag = true;
        erosionMenuFlag = false;
        filterMenuFlag = false ;
        riverMenuFlag = false;
        debugMenuFlag = false;

        messageFlag = false;
        //messageEndFrame = 666;

        terrainProcessing = false;

        scaleY = cm.scaleTerrainY;
        visibleArea = cm.terrainWidth;
        //visibleArea = 100;
        patchSize = cm.patchSize;

        message = new GUIMessage(this);//has to be declared first!

        menu = new GUIMenu(this);
        cameraMenu = new GUICamera(this);
        mesh = new GUIMesh(this);
        export = new GUIExport(this);
        progress = new GUIProgress(this);
        filter = new GUIFilters(this);
        river = new GUIRiver(this);
        debug = new GUIDebug(this);
        erosion = new GUIErosion(this);

        AssignFunctions();
    }
开发者ID:ja003,项目名称:Fractal-Nature-II,代码行数:41,代码来源:GUIManager.cs

示例10: OnMessage

  /// <summary>
  /// 
  /// </summary>
  /// <param name="message"></param>
  private void OnMessage(GUIMessage message)
  {
    if (!_suspended && !ExitToTray && !IsVisible)
    {
      switch (message.Message)
      {
        case GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW:
        case GUIMessage.MessageType.GUI_MSG_GETFOCUS:
          Log.Debug("Main: Setting focus");
          if (Volume > 0 && (g_Player.IsVideo || g_Player.IsTV))
          {
            g_Player.Volume = Volume;
            if (g_Player.Paused)
            {
              g_Player.Pause();
            }
          }
          RestoreFromTray();
          break;
      }
    }

    if (!_suspended && AppActive)
    {
      switch (message.Message)
      {
        case GUIMessage.MessageType.GUI_MSG_RESTART_REMOTE_CONTROLS:
          Log.Info("Main: Restart remote controls");
          InputDevices.Stop();
          InputDevices.Init();
          break;

        case GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW:
          GUIWindowManager.ActivateWindow(message.Param1);
          GUIGraphicsContext.IsFullScreenVideo = GUIWindowManager.ActiveWindow == (int) GUIWindow.Window.WINDOW_TVFULLSCREEN ||
                                                 GUIWindowManager.ActiveWindow == (int) GUIWindow.Window.WINDOW_FULLSCREEN_TELETEXT ||
                                                 GUIWindowManager.ActiveWindow == (int) GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO ||
                                                 GUIWindowManager.ActiveWindow == (int) GUIWindow.Window.WINDOW_FULLSCREEN_MUSIC;
          break;

        case GUIMessage.MessageType.GUI_MSG_CD_INSERTED:
          AutoPlay.ExamineCD(message.Label);
          break;

        case GUIMessage.MessageType.GUI_MSG_VOLUME_INSERTED:
          AutoPlay.ExamineVolume(message.Label);
          break;

        case GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL:
          double retNum;
          bool bIsInteger = Double.TryParse(message.Label, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out retNum);
          try
          {
            if (bIsInteger)
            {
              _usbuirtdevice.ChangeTunerChannel(message.Label);
            }
          }
          // ReSharper disable EmptyGeneralCatchClause
          catch {}
          // ReSharper restore EmptyGeneralCatchClause

          try
          {
            _winlircdevice.ChangeTunerChannel(message.Label);
          }
          // ReSharper disable EmptyGeneralCatchClause
          catch { }
          // ReSharper restore EmptyGeneralCatchClause
          
          try
          {
            if (bIsInteger)
            {
              _redeyedevice.ChangeTunerChannel(message.Label);
            }
          }
          // ReSharper disable EmptyGeneralCatchClause
          catch {}
          // ReSharper restore EmptyGeneralCatchClause
          break;

        case GUIMessage.MessageType.GUI_MSG_SWITCH_FULL_WINDOWED:
          Log.Info("Main: GUI_MSG_SWITCH_FULL_WINDOWED message is obsolete.");
          break;

        case GUIMessage.MessageType.GUI_MSG_GETFOCUS:
          Log.Debug("Main: Setting focus");
          if (WindowState != FormWindowState.Minimized)
          {
            Activate();
          }
          else
          {
            if (Volume > 0 && (g_Player.IsVideo || g_Player.IsTV))
            {
//.........这里部分代码省略.........
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:101,代码来源:MediaPortal.cs

示例11: OnAction


//.........这里部分代码省略.........
          //break;

          //mute or unmute audio
        case Action.ActionType.ACTION_VOLUME_MUTE:
          VolumeHandler.Instance.IsMuted = !VolumeHandler.Instance.IsMuted;
          break;

          //decrease volume 
        case Action.ActionType.ACTION_VOLUME_DOWN:
          VolumeHandler.Instance.Volume = VolumeHandler.Instance.Previous;
          break;

          //increase volume 
        case Action.ActionType.ACTION_VOLUME_UP:
          VolumeHandler.Instance.Volume = VolumeHandler.Instance.Next;
          break;

          //toggle live tv in background
        case Action.ActionType.ACTION_BACKGROUND_TOGGLE:
          //show livetv or video as background instead of the static GUI background
          // toggle livetv/video in background on/pff
          if (GUIGraphicsContext.ShowBackground)
          {
            Log.Info("Main: Using live TV as background");
            // if on, but we're not playing any video or watching tv
            if (GUIGraphicsContext.Vmr9Active)
            {
              GUIGraphicsContext.ShowBackground = false;
              //GUIGraphicsContext.Overlay = false;
            }
            else
            {
              //show warning message
              GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SHOW_WARNING, 0, 0, 0, 0, 0, 0);
              msg.Param1 = 727; //Live tv in background
              msg.Param2 = 728; //No Video/TV playing
              msg.Param3 = 729; //Make sure that something is playing
              GUIWindowManager.SendMessage(msg);
              return;
            }
          }
          else
          {
            Log.Info("Main: Using GUI as background");
            GUIGraphicsContext.ShowBackground = true;
            //GUIGraphicsContext.Overlay = true;
          }
          return;

          //switch between several home windows
        case Action.ActionType.ACTION_SWITCH_HOME:
          GUIMessage homeMsg;
          GUIWindow.Window newHome = _startWithBasicHome
                                       ? GUIWindow.Window.WINDOW_SECOND_HOME
                                       : GUIWindow.Window.WINDOW_HOME;
          // do we prefer to use only one home screen?
          if (_useOnlyOneHome)
          {
            // skip if we are already in there
            if (GUIWindowManager.ActiveWindow == (int)newHome)
            {
              return;
            }
          }
            // we like both 
          else
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:67,代码来源:MediaPortal.cs

示例12: OnResumeSuspend

  /// <summary>
  /// This event is sent with the  PBT_APMRESUMEAUTOMATIC event if the system has resumed operation due to user activity.
  /// </summary>
  private void OnResumeSuspend()
  {
    // avoid screen saver after standby
    GUIGraphicsContext.ResetLastActivity();
    _ignoreContextMenuAction = false;

    // Systems without DirectX9Ex have lost graphics device in suspend/hibernate cycle
    if (!GUIGraphicsContext.IsDirectX9ExUsed())
    {
      Log.Debug("Main: OnResumeSuspend - set GUIGraphicsContext.State.LOST");
      GUIGraphicsContext.CurrentState = GUIGraphicsContext.State.LOST;
    }

    if (!_showLastActiveModule && !Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow())
      && GUIWindowManager.ActiveWindow != (int)GUIWindow.Window.WINDOW_HOME
      && GUIWindowManager.ActiveWindow != (int)GUIWindow.Window.WINDOW_SECOND_HOME)
    {
      if (_startWithBasicHome && File.Exists(GUIGraphicsContext.GetThemedSkinFile(@"\basichome.xml")))
      {
        Log.Info("Main: OnResumeSuspend - Switch to basic home screen");
        GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_SECOND_HOME);
      }
      else
      {
        Log.Info("Main: OnResumeSuspend - Switch to home screen");
        GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_HOME);
      }
      GUIWindowManager.ResetWindowsHistory();
    }

    GUIMessage message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ONRESUME, 0, 0, 0, 0, 0, null);
    GUIGraphicsContext.SendMessage(message); 

    RecoverDevice();

    if (GUIGraphicsContext.IsDirectX9ExUsed())
    {
      Log.Debug("Main: OnResumeSuspend - set GUIGraphicsContext.State.RUNNING");
      GUIGraphicsContext.CurrentState = GUIGraphicsContext.State.RUNNING;
    }

    Log.Debug("Main: OnResumeSuspend - Init Input Devices");
    InputDevices.Init();

    Log.Debug("Main: OnResumeSuspend - Autoplay start listening");
    AutoPlay.StartListening();

    Log.Debug("Main: OnResumeSuspend - Initializing volume handler");
    try
    {
#pragma warning disable 168
      VolumeHandler vh = VolumeHandler.Instance;
#pragma warning restore 168
    }
    catch (Exception exception)
    {
      Log.Warn("Main: OnResumeSuspend - Could not initialize volume handler: ", exception.Message);
    }

    _suspended = false;
    _lastOnresume = DateTime.Now;
    Log.Info("Main: OnResumeSuspend - Done");
  }
开发者ID:Eddie-Jee,项目名称:MediaPortal-1,代码行数:66,代码来源:MediaPortal.cs

示例13: OnPostRenderAction

    private int OnPostRenderAction(Action action, GUIMessage msg, bool focus)
    {
      if (msg != null)
      {
        if (msg.Message == GUIMessage.MessageType.GUI_MSG_LOSTFOCUS ||
            msg.Message == GUIMessage.MessageType.GUI_MSG_SETFOCUS)
        {
          if (Focused)
          {
            if (DoesPostRender())
            {
              OnMessage(msg);
              return (int)(Focused ? GUIWindowManager.FocusState.FOCUSED : GUIWindowManager.FocusState.NOT_FOCUSED);
            }
          }
        }
      }

      if (action != null)
      {
        if (action.wID == Action.ActionType.ACTION_MOVE_LEFT ||
            action.wID == Action.ActionType.ACTION_MOVE_RIGHT ||
            action.wID == Action.ActionType.ACTION_MOVE_UP ||
            action.wID == Action.ActionType.ACTION_MOVE_DOWN ||
            action.wID == Action.ActionType.ACTION_SELECT_ITEM)
        {
          if (Focused)
          {
            if (DoesPostRender())
            {
              bool foc = Focused;
              OnAction(action);
              return
                (int)
                (Focused
                   ? GUIWindowManager.FocusState.FOCUSED
                   : (foc == Focused
                        ? GUIWindowManager.FocusState.NOT_FOCUSED
                        : GUIWindowManager.FocusState.JUST_LOST_FOCUS));
            }
          }
        }
        if (action.wID == Action.ActionType.ACTION_MOUSE_CLICK || action.wID == Action.ActionType.ACTION_MOUSE_DOUBLECLICK)
        {
          int x = (int)action.fAmount1;
          int y = (int)action.fAmount2;
          if (DoesPostRender() && InWindow(x, y))
          {
            OnAction(action);
            return (int)GUIWindowManager.FocusState.FOCUSED;
          }
        }
        if (action.wID == Action.ActionType.ACTION_MOUSE_MOVE)
        {
          if (DoesPostRender())
          {
            OnAction(action);
          }
        }
      }
      if (focus && msg == null)
      {
        if (DoesPostRender())
        {
          if (ShouldFocus(action))
          {
            Focused = true;
            return (int)GUIWindowManager.FocusState.FOCUSED;
          }
        }
        Focused = false;
      }
      return (int)GUIWindowManager.FocusState.NOT_FOCUSED;
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:74,代码来源:GUIOverlayWindow.cs

示例14: OnAction


//.........这里部分代码省略.........
          ToggleFullscreen();
          return;

        // mute or unmute audio
        case Action.ActionType.ACTION_VOLUME_MUTE:
          VolumeHandler.Instance.IsMuted = !VolumeHandler.Instance.IsMuted;
          break;

        // decrease volume 
        case Action.ActionType.ACTION_VOLUME_DOWN:
          VolumeHandler.Instance.Volume = VolumeHandler.Instance.Previous;
          break;

        // increase volume 
        case Action.ActionType.ACTION_VOLUME_UP:
          VolumeHandler.Instance.Volume = VolumeHandler.Instance.Next;
          break;

        // toggle live tv in background
        case Action.ActionType.ACTION_BACKGROUND_TOGGLE:
          // show livetv or video as background instead of the static GUI background
          // toggle livetv/video in background on/off
          if (GUIGraphicsContext.ShowBackground)
          {
            Log.Info("Main: Using live TV as background");
            // if on, but we're not playing any video or watching tv
            if (GUIGraphicsContext.Vmr9Active)
            {
              GUIGraphicsContext.ShowBackground = false;
            }
            else
            {
              // show warning message
              var msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SHOW_WARNING, 0, 0, 0, 0, 0, 0) {Param1 = 727, Param2 = 728, Param3 = 729};
              GUIWindowManager.SendMessage(msg);
              return;
            }
          }
          else
          {
            Log.Info("Main: Using GUI as background");
            GUIGraphicsContext.ShowBackground = true;
          }
          break;

        // switch between several home windows
        case Action.ActionType.ACTION_SWITCH_HOME:
          GUIWindow.Window newHome = _startWithBasicHome
                                       ? GUIWindow.Window.WINDOW_SECOND_HOME
                                       : GUIWindow.Window.WINDOW_HOME;
          // do we prefer to use only one home screen?
          if (_useOnlyOneHome)
          {
            // skip if we are already in there
            if (GUIWindowManager.ActiveWindow == (int)newHome)
            {
              break;
            }
          }
          // we like both 
          else
          {
            // if already in one home switch to the other
            switch (GUIWindowManager.ActiveWindow)
            {
              case (int)GUIWindow.Window.WINDOW_HOME:
开发者ID:GhoSe-OSS,项目名称:MonoTV,代码行数:67,代码来源:MediaPortal.cs

示例15: OnMessage

  /// <summary>
  /// 
  /// </summary>
  /// <param name="message"></param>
  private void OnMessage(GUIMessage message)
  {
    if (!_suspended && AppActive)
    {
      switch (message.Message)
      {
        case GUIMessage.MessageType.GUI_MSG_RESTART_REMOTE_CONTROLS:
          Log.Info("Main: Restart remote controls");
          InputDevices.Stop();
          InputDevices.Init();
          break;

        case GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW:
          GUIWindowManager.ActivateWindow(message.Param1);
          GUIGraphicsContext.IsFullScreenVideo = GUIWindowManager.ActiveWindow == (int) GUIWindow.Window.WINDOW_TVFULLSCREEN ||
                                                 GUIWindowManager.ActiveWindow == (int) GUIWindow.Window.WINDOW_FULLSCREEN_TELETEXT ||
                                                 GUIWindowManager.ActiveWindow == (int) GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO ||
                                                 GUIWindowManager.ActiveWindow == (int) GUIWindow.Window.WINDOW_FULLSCREEN_MUSIC;
          break;

        case GUIMessage.MessageType.GUI_MSG_CD_INSERTED:
          AutoPlay.ExamineCD(message.Label);
          break;

        case GUIMessage.MessageType.GUI_MSG_VOLUME_INSERTED:
          AutoPlay.ExamineVolume(message.Label);
          break;

        case GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL:
          double retNum;
          bool bIsInteger = Double.TryParse(message.Label, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out retNum);
          try
          {
            if (bIsInteger)
            {
              _usbuirtdevice.ChangeTunerChannel(message.Label);
            }
          }
          // ReSharper disable EmptyGeneralCatchClause
          catch {}
          // ReSharper restore EmptyGeneralCatchClause

          try
          {
            _winlircdevice.ChangeTunerChannel(message.Label);
          }
          // ReSharper disable EmptyGeneralCatchClause
          catch { }
          // ReSharper restore EmptyGeneralCatchClause
          
          try
          {
            if (bIsInteger)
            {
              _redeyedevice.ChangeTunerChannel(message.Label);
            }
          }
          // ReSharper disable EmptyGeneralCatchClause
          catch {}
          // ReSharper restore EmptyGeneralCatchClause
          break;

        case GUIMessage.MessageType.GUI_MSG_SWITCH_FULL_WINDOWED:
          Log.Info("Main: GUI_MSG_SWITCH_FULL_WINDOWED message is obsolete.");
          break;

        case GUIMessage.MessageType.GUI_MSG_GETFOCUS:
          Log.Debug("Main: Setting focus");
          if (WindowState != FormWindowState.Minimized)
          {
            Activate();
          }
          else
          {
            if (Volume > 0 && (g_Player.IsVideo || g_Player.IsTV))
            {
              g_Player.Volume = Volume;
              if (g_Player.Paused)
              {
                g_Player.Pause();
              }
            }
            RestoreFromTray();
          }
          break;

        case GUIMessage.MessageType.GUI_MSG_CODEC_MISSING:
          var dlgOk = (GUIDialogOK) GUIWindowManager.GetWindow((int) GUIWindow.Window.WINDOW_DIALOG_OK);
          dlgOk.SetHeading(string.Empty);
          dlgOk.SetLine(1, message.Label);
          dlgOk.SetLine(2, string.Empty);
          dlgOk.SetLine(3, message.Label2);
          dlgOk.SetLine(4, message.Label3);
          dlgOk.DoModal(GUIWindowManager.ActiveWindow);
          break;

//.........这里部分代码省略.........
开发者ID:GhoSe-OSS,项目名称:MonoTV,代码行数:101,代码来源:MediaPortal.cs


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