本文整理汇总了C#中MediaPortal.GUI.Library.Action.IsUserAction方法的典型用法代码示例。如果您正苦于以下问题:C# Action.IsUserAction方法的具体用法?C# Action.IsUserAction怎么用?C# Action.IsUserAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPortal.GUI.Library.Action
的用法示例。
在下文中一共展示了Action.IsUserAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnAction
/// <summary>
///
/// </summary>
/// <param name="action"></param>
private void OnAction(Action action)
{
try
{
// hack/fix for lastactivemodulefullscreen
// when recovering from hibernation/standby after closing with remote control somehow a F9 (keycode 120) onkeydown event is thrown from outside
// we are currently filtering it away.
// sometimes more than one F9 keydown event fired.
// if these events are not filtered away the F9 context menu is shown on the restored/shown module.
if ((action.wID == Action.ActionType.ACTION_CONTEXT_MENU || _suspended) && (_showLastActiveModule))
{
if (_ignoreContextMenuAction)
{
_ignoreContextMenuAction = false;
_lastContextMenuAction = DateTime.Now;
return;
}
if (_lastContextMenuAction != DateTime.MaxValue)
{
TimeSpan ts = _lastContextMenuAction - DateTime.Now;
if (ts.TotalMilliseconds > -100)
{
_ignoreContextMenuAction = false;
_lastContextMenuAction = DateTime.Now;
return;
}
}
_lastContextMenuAction = DateTime.Now;
}
GUIWindow window;
if (action.IsUserAction())
{
GUIGraphicsContext.ResetLastActivity();
}
switch (action.wID)
{
// record current tv program
case Action.ActionType.ACTION_RECORD:
if ((GUIGraphicsContext.IsTvWindow(GUIWindowManager.ActiveWindowEx) &&
GUIWindowManager.ActiveWindowEx != (int)GUIWindow.Window.WINDOW_TVGUIDE) &&
(GUIWindowManager.ActiveWindowEx != (int)GUIWindow.Window.WINDOW_DIALOG_TVGUIDE))
{
GUIWindow tvHome = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TV);
if (tvHome != null && tvHome.GetID != GUIWindowManager.ActiveWindow)
{
tvHome.OnAction(action);
return;
}
}
break;
// TV: zap to previous channel
case Action.ActionType.ACTION_PREV_CHANNEL:
if (!GUIWindowManager.IsRouted)
{
window = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TV);
window.OnAction(action);
return;
}
break;
// TV: zap to next channel
case Action.ActionType.ACTION_NEXT_CHANNEL:
if (!GUIWindowManager.IsRouted)
{
window = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TV);
window.OnAction(action);
return;
}
break;
// TV: zap to last channel viewed
case Action.ActionType.ACTION_LAST_VIEWED_CHANNEL: // mPod
if (!GUIWindowManager.IsRouted)
{
window = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TV);
window.OnAction(action);
return;
}
break;
// toggle between windowed and fullscreen mode
case Action.ActionType.ACTION_TOGGLE_WINDOWED_FULLSCREEN:
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:
//.........这里部分代码省略.........
示例2: OnAction
private void OnAction(Action action)
{
try
{
// hack/fix for lastactivemodulefullscreen
// when recovering from hibernation/standby after closing with remote control somehow a F9 (keycode 120) onkeydown event is thrown from outside
// we are currently filtering it away.
// sometimes more than one F9 keydown event fired.
// if these events are not filtered away the F9 context menu is shown on the restored/shown module.
if ((action.wID == Action.ActionType.ACTION_CONTEXT_MENU || _suspended) && (showLastActiveModule))
{
//Log.Info("ACTION_CONTEXT_MENU, ignored = {0}, suspended = {1}", ignoreContextMenuAction, _suspended);
if (ignoreContextMenuAction)
{
ignoreContextMenuAction = false;
lastContextMenuAction = DateTime.Now;
return;
}
else if (lastContextMenuAction != DateTime.MaxValue)
{
TimeSpan ts = lastContextMenuAction - DateTime.Now;
if (ts.TotalMilliseconds > -100)
{
ignoreContextMenuAction = false;
lastContextMenuAction = DateTime.Now;
return;
}
}
lastContextMenuAction = DateTime.Now;
}
GUIWindow window;
if (action.IsUserAction())
{
GUIGraphicsContext.ResetLastActivity();
}
switch (action.wID)
{
// record current tv program
case Action.ActionType.ACTION_RECORD:
if ((GUIGraphicsContext.IsTvWindow(GUIWindowManager.ActiveWindowEx) &&
GUIWindowManager.ActiveWindowEx != (int)GUIWindow.Window.WINDOW_TVGUIDE) &&
(GUIWindowManager.ActiveWindowEx != (int)GUIWindow.Window.WINDOW_DIALOG_TVGUIDE))
{
GUIWindow tvHome = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TV);
if (tvHome != null)
{
if (tvHome.GetID != GUIWindowManager.ActiveWindow)
{
tvHome.OnAction(action);
return;
}
}
}
break;
//TV: zap to previous channel
case Action.ActionType.ACTION_PREV_CHANNEL:
if (!GUIWindowManager.IsRouted)
{
window = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TV);
window.OnAction(action);
return;
}
break;
//TV: zap to next channel
case Action.ActionType.ACTION_NEXT_CHANNEL:
if (!GUIWindowManager.IsRouted)
{
window = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TV);
window.OnAction(action);
return;
}
break;
//TV: zap to last channel viewed
case Action.ActionType.ACTION_LAST_VIEWED_CHANNEL: // mPod
if (!GUIWindowManager.IsRouted)
{
window = GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_TV);
window.OnAction(action);
return;
}
break;
//toggle between directx windowed and exclusive mode
case Action.ActionType.ACTION_TOGGLE_WINDOWED_FULLSCREEN:
ToggleFullWindowed();
return;
//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;
//.........这里部分代码省略.........