コード例 #1
0
        /// <summary>
        /// Get a INavigagble that exists from a List &gt;INavigable&lt; after the UI action is completed.
        /// </summary>
        /// <param name="origin">The origin.</param>
        /// <param name="onActionAlternatives">The OnActionAlternatives.</param>
        /// <returns>The matching INavigable, otherwise <c>null</c>.</returns>
        public virtual INavigable GetINavigableAfterAction(INavigable origin, IOnActionAlternatives onActionAlternatives)
        {
            ValidateINavigableExists(origin, "origin");
            INavigable match = null;

            onActionAlternatives.UIAction.Invoke();
            match = GetFirstINavigableExisting(onActionAlternatives.INavigables);
            return(match);
        }
コード例 #2
0
        /// <summary>
        /// Resolve a path when one Action leads to more than one INavigable.
        /// This method will search for the first match from OnActionAlternatives list.
        /// An exception will be raised if no path exists between them.
        /// </summary>
        /// <param name="origin">The origin before Action invocation.</param>
        /// <param name="onActionAlternatives">All the alternative INavigables that can be rebased.</param>
        /// <param name="waypoint">An INavigable waypoint to cross if the expected INavigable is not cross during the resolution.</param>
        /// <returns>The destination.</returns>
        public virtual INavigable Resolve(INavigable origin, IOnActionAlternatives onActionAlternatives, INavigable waypoint)
        {
            // gotoDestination will be reset with the first call to GoTo().
            var finalDestination     = gotoDestination;
            var navigableAfterAction = GetINavigableAfterAction(origin, onActionAlternatives);

            if (CompareTypeNames(navigableAfterAction, finalDestination))
            {
                return(navigableAfterAction);
            }
            else
            {
                // Force to pass by waypoint.
                GoTo(navigableAfterAction, waypoint);
                return(GoTo(waypoint, finalDestination));
            }
        }
コード例 #3
0
        /// <summary>
        /// Resolve a path when one Action leads to more than one page.
        /// This method will search for the first match from OnActionAlternatives list.
        /// An exception will be raised if no path exists between them.
        /// </summary>
        /// <param name="origin">The origin before Action invocation.</param>
        /// <param name="onActionAlternatives">All the alternative INavigables that can be rebased.</param>
        /// <returns>The destination.</returns>
        public virtual INavigable Resolve(INavigable origin, IOnActionAlternatives onActionAlternatives)
        {
            var newOrigin = GetINavigableAfterAction(origin, onActionAlternatives);

            return(GoTo(newOrigin, gotoDestination));
        }