示例#1
0
        public CachedWrappedStrategist(
            IStrategist <TNode, TPayload> baseStrategist,
            Func <INavigator <TNode, TPayload>, INavigator <TNode, TPayload> > getNavigator)
        {
            Contract.Requires(baseStrategist != null);
            Contract.Requires(getNavigator != null);

            this.baseStrategist          = baseStrategist;
            this.getNavigator            = getNavigator;
            this.cachedWrappedNavigators = new Dictionary <INavigator <TNode, TPayload>, INavigator <TNode, TPayload> >(ReferenceEqualityComparer.Instance);
        }
示例#2
0
        public static void Walk <TNode, TPayload>(TNode root,
                                                  IStrategist <TNode, TPayload> strategySelector,
                                                  TPayload payload,
                                                  IEqualityComparer <TNode> equalityComparer = null)
        {
            var walk = new SelfSufficientRoute <TNode, TPayload>(strategySelector, payload, equalityComparer);

            walk.Visit(root);

#if DEBUG
            DebuggingInfo = walk.DebuggingInfo;
#endif
        }
示例#3
0
 public NavigatorDelegateRedirecter(IStrategist <TNode, TPayload> strategist) : this(strategist.ChooseNavigator)
 {
 }
示例#4
0
 public SelfSufficientRoute(IStrategist <TNode, TPayload> strategist, TPayload payload, IEqualityComparer <TNode> equalityComparer = null)
     : base(equalityComparer)
 {
     this.payload    = payload;
     this.strategist = strategist;
 }