コード例 #1
0
        private void registerOrFilter(IChainFilter filter)
        {
            IChainFilter last = _wheres.LastOrDefault();

            if (last == null)
            {
                _wheres.Add(filter);
            }
            else
            {
                if (last is OrChainFilter)
                {
                    last.As <OrChainFilter>().Add(filter);
                }
                else
                {
                    _wheres.Remove(last);
                    var orFilter = new OrChainFilter();
                    orFilter.Add(last);
                    orFilter.Add(filter);

                    _wheres.Add(orFilter);
                }
            }
        }
コード例 #2
0
		public void SetUp()
		{
			theFilter = MockRepository.GenerateStub<IChainFilter>();
			theMode = FormMode.Ajax;
			theChain = new BehaviorChain();

			thePolicy = new FormModePolicy(theFilter, theMode);
		}
コード例 #3
0
        public void SetUp()
        {
            theFilter = MockRepository.GenerateStub <IChainFilter>();
            theMode   = FormMode.Ajax;
            theChain  = new BehaviorChain();

            thePolicy = new FormModePolicy(theFilter, theMode);
        }
コード例 #4
0
        public void SetUp()
        {
            f1 = MockRepository.GenerateMock <IChainFilter>();
            f2 = MockRepository.GenerateMock <IChainFilter>();
            f3 = MockRepository.GenerateMock <IChainFilter>();

            chain = new BehaviorChain();

            filter = new AndChainFilter(f1, f2, f3);
        }
コード例 #5
0
        public void SetUp()
        {
            f1 = MockRepository.GenerateMock<IChainFilter>();
            f2 = MockRepository.GenerateMock<IChainFilter>();
            f3 = MockRepository.GenerateMock<IChainFilter>();

            chain = new BehaviorChain();

            filter = new AndChainFilter(f1, f2, f3);            
        }
コード例 #6
0
ファイル: ChainPredicateTester.cs プロジェクト: xeno3/fubumvc
        public void SetUp()
        {
            thePredicate = new ChainPredicate();

            filter1 = MockRepository.GenerateMock <IChainFilter>();
            filter2 = MockRepository.GenerateMock <IChainFilter>();
            filter3 = MockRepository.GenerateMock <IChainFilter>();
            filter4 = MockRepository.GenerateMock <IChainFilter>();

            thePredicate.Matching(filter1);
            thePredicate.Matching(filter2);
            thePredicate.Matching(filter3);
            thePredicate.Matching(filter4);

            aChain = new BehaviorChain();
        }
コード例 #7
0
        public void SetUp()
        {
            theFilter = new OrChainFilter();

            filter1 = MockRepository.GenerateMock <IChainFilter>();
            filter2 = MockRepository.GenerateMock <IChainFilter>();
            filter3 = MockRepository.GenerateMock <IChainFilter>();
            filter4 = MockRepository.GenerateMock <IChainFilter>();

            theFilter.Add(filter1);
            theFilter.Add(filter2);
            theFilter.Add(filter3);
            theFilter.Add(filter4);

            aChain = new BehaviorChain();
        }
コード例 #8
0
ファイル: ChainPredicate.cs プロジェクト: xeno3/fubumvc
        private void and(IChainFilter filter)
        {
            var last = _filters.LastOrDefault();

            if (last == null)
            {
                _filters.Add(filter);

                return;
            }

            var and = last as AndChainFilter;

            if (and == null)
            {
                _filters.Remove(last);
                and = new AndChainFilter(last);
                _filters.Add(and);
            }

            and.Add(filter);
        }
コード例 #9
0
 public void ForChainsMatching(IChainFilter filter, FormMode mode)
 {
     addPolicy(new FormModePolicy(filter, mode));
 }
コード例 #10
0
 public ValidationNodeModification(IChainFilter filter, Action <ValidationNode> action)
 {
     _filter = filter;
     _action = action;
 }
コード例 #11
0
ファイル: ChainPredicate.cs プロジェクト: xeno3/fubumvc
 /// <summary>
 /// Directly add an IChainFilter "where" filter to this policy
 /// </summary>
 /// <param name="filter"></param>
 /// <returns></returns>
 public IOrExpression Matching(IChainFilter filter)
 {
     return(addFilter(filter));
 }
コード例 #12
0
ファイル: ChainPredicate.cs プロジェクト: xeno3/fubumvc
 private IOrExpression addFilter(IChainFilter filter)
 {
     _add(filter);
     return(this);
 }
コード例 #13
0
 public FormModePolicy(IChainFilter filter, FormMode mode)
 {
     _filter = filter;
     _mode   = mode;
 }
コード例 #14
0
ファイル: BehaviorChainPolicy.cs プロジェクト: moacap/fubumvc
 public void Add(IChainFilter filter)
 {
     _filters.Add(filter);
 }
コード例 #15
0
 public void ForChainsMatching(IChainFilter filter, Action <ValidationNode> action)
 {
     addModification(new ValidationNodeModification(filter, action));
 }
コード例 #16
0
		public ValidationNodeModification(IChainFilter filter, Action<ValidationNode> action)
		{
			_filter = filter;
			_action = action;
		}
コード例 #17
0
		public FormModePolicy(IChainFilter filter, FormMode mode)
		{
			_filter = filter;
			_mode = mode;
		}
コード例 #18
0
        public void SetUp()
        {
            thePredicate = new ChainPredicate();

            filter1 = MockRepository.GenerateMock<IChainFilter>();
            filter2 = MockRepository.GenerateMock<IChainFilter>();
            filter3 = MockRepository.GenerateMock<IChainFilter>();
            filter4 = MockRepository.GenerateMock<IChainFilter>();

            thePredicate.Matching(filter1);
            thePredicate.Matching(filter2);
            thePredicate.Matching(filter3);
            thePredicate.Matching(filter4);

            aChain = new BehaviorChain();
        }
コード例 #19
0
ファイル: OrChainFilter.cs プロジェクト: chester89/fubumvc
 public void Add(IChainFilter filter)
 {
     _filters.Add(filter);
 }