Ejemplo n.º 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);
        }
Ejemplo n.º 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
        }
Ejemplo n.º 3
0
 public NavigatorDelegateRedirecter(IStrategist <TNode, TPayload> strategist) : this(strategist.ChooseNavigator)
 {
 }
Ejemplo n.º 4
0
 public SelfSufficientRoute(IStrategist <TNode, TPayload> strategist, TPayload payload, IEqualityComparer <TNode> equalityComparer = null)
     : base(equalityComparer)
 {
     this.payload    = payload;
     this.strategist = strategist;
 }