Ejemplo n.º 1
0
        private double _currentPlaybackRate = 1.0; // Todo - move to reportable property of IPlaybackManager

        public DefaultCommandActionMap(IPresentationManager presentationManager, IPlaybackManager playbackManager, INavigationService navigationService, IScreensaverManager screensaverManager, ILogManager logManager)
        {
            _presentationManager = presentationManager;
            _playbackManager     = playbackManager;
            _screensaverManager  = screensaverManager;
            _navigationService   = navigationService;
            _logger = logManager.GetLogger(GetType().Name);
            _globalCommandActionMap   = CreateGlobalCommandActionMap();
            _nullCommandActionMapping = new CommandActionMapping(Command.Null, NullAction);

            _playbackManager.PlaybackStarted   += PlaybackManagerPlaybackManagerStarted;
            _playbackManager.PlaybackCompleted += PlaybackManagerPlaybackManagerCompleted;
        }
Ejemplo n.º 2
0
        private Boolean ExecuteCommandAction(CommandActionMapping commandActionMapping, Object args)
        {
            _logger.Debug("ExecuteCommandAction {0} {1}", commandActionMapping.Command, commandActionMapping.Args);
            var handled = false;

            try
            {
                var commandEventArgs = new CommandEventArgs()
                {
                    Args    = args ?? commandActionMapping.Args,
                    Command = commandActionMapping.Command,
                    Handled = false
                };

                commandActionMapping.Action(this, commandEventArgs);
                handled = commandEventArgs.Handled;
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error executing CommandAction", ex);
            }
            return(handled);
        }