예제 #1
0
        protected void LeaveMediaItemActionState()
        {
            IWorkflowManager workflowManager = ServiceRegistration.Get <IWorkflowManager>();

            if (_deferredAction?.DoesChangeWorkflow ?? false)
            {
                workflowManager.StartBatchUpdate();
            }
            workflowManager.NavigatePop(1);
        }
        protected void LeaveMediaItemActionState()
        {
            IWorkflowManager workflowManager = ServiceRegistration.Get <IWorkflowManager>();

            workflowManager.NavigatePop(1);
        }
        /// <summary>
        /// Updates the menu items for the dialogs "DialogPlayerConfiguration" and "DialogChooseAudioStream"
        /// and closes the dialogs when their entries are not valid any more.
        /// </summary>
        protected void CheckUpdatePlayerConfigurationData()
        {
            IWorkflowManager workflowManager = ServiceRegistration.Get <IWorkflowManager>();

            lock (_syncObj)
            {
                if (_inPlayerConfigurationDialog)
                {
                    UpdatePlayerConfigurationMenu();
                    if (_playerConfigurationMenu.Count == 0)
                    {
                        // Automatically close player configuration dialog if no menu items are available any more
                        workflowManager.NavigatePopToStateAsync(Consts.WF_STATE_ID_PLAYER_CONFIGURATION_DIALOG, true);
                    }
                }
                if (_inChooseAudioStreamDialog)
                {
                    UpdateAudioStreamsMenu();
                    if (_audioStreamsMenu.Count <= 1)
                    {
                        // Automatically close audio stream choice dialog if less than two audio streams are available
                        workflowManager.NavigatePopToStateAsync(Consts.WF_STATE_ID_CHOOSE_AUDIO_STREAM_DIALOG, true);
                    }
                }
                if (_inPlayerSlotAudioMenuDialog)
                {
                    UpdatePlayerSlotAudioMenu();
                    if (_playerSlotAudioMenu.Count <= 1)
                    {
                        // Automatically close audio stream choice dialog if less than two audio streams are available
                        workflowManager.NavigatePopToStateAsync(Consts.WF_STATE_ID_PLAYER_AUDIO_MENU_DIALOG, true);
                    }
                }
                if (_inPlayerChooseGeometryMenuDialog)
                {
                    // Automatically close geometry choice dialog if current player is no video player
                    if (_playerGeometryMenuPlayerContext == null || !_playerGeometryMenuPlayerContext.IsActive ||
                        !(_playerGeometryMenuPlayerContext.CurrentPlayer is IVideoPlayer))
                    {
                        // Automatically close geometry stream choice dialog
                        workflowManager.NavigatePopToStateAsync(Consts.WF_STATE_ID_PLAYER_CHOOSE_GEOMETRY_MENU_DIALOG, true);
                    }
                    else
                    {
                        UpdatePlayerChooseGeometryMenu();
                    }
                }
                if (_inPlayerChooseEffectMenuDialog)
                {
                    // Automatically close Effect choice dialog if current player is no video player
                    if (_playerEffectMenuPlayerContext == null || !_playerEffectMenuPlayerContext.IsActive ||
                        !(_playerEffectMenuPlayerContext.CurrentPlayer is IVideoPlayer))
                    {
                        // Automatically close effect stream choice dialog
                        while (_inPlayerChooseEffectMenuDialog)
                        {
                            workflowManager.NavigatePop(1);
                        }
                    }
                    else
                    {
                        UpdatePlayerChooseEffectMenu();
                    }
                }
            }
        }