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); } } }
public void SetUp() { theFilter = MockRepository.GenerateStub<IChainFilter>(); theMode = FormMode.Ajax; theChain = new BehaviorChain(); thePolicy = new FormModePolicy(theFilter, theMode); }
public void SetUp() { theFilter = MockRepository.GenerateStub <IChainFilter>(); theMode = FormMode.Ajax; theChain = new BehaviorChain(); thePolicy = new FormModePolicy(theFilter, theMode); }
public void SetUp() { f1 = MockRepository.GenerateMock <IChainFilter>(); f2 = MockRepository.GenerateMock <IChainFilter>(); f3 = MockRepository.GenerateMock <IChainFilter>(); chain = new BehaviorChain(); filter = new AndChainFilter(f1, f2, f3); }
public void SetUp() { f1 = MockRepository.GenerateMock<IChainFilter>(); f2 = MockRepository.GenerateMock<IChainFilter>(); f3 = MockRepository.GenerateMock<IChainFilter>(); chain = new BehaviorChain(); filter = new AndChainFilter(f1, f2, f3); }
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(); }
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(); }
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); }
public void ForChainsMatching(IChainFilter filter, FormMode mode) { addPolicy(new FormModePolicy(filter, mode)); }
public ValidationNodeModification(IChainFilter filter, Action <ValidationNode> action) { _filter = filter; _action = action; }
/// <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)); }
private IOrExpression addFilter(IChainFilter filter) { _add(filter); return(this); }
public FormModePolicy(IChainFilter filter, FormMode mode) { _filter = filter; _mode = mode; }
public void Add(IChainFilter filter) { _filters.Add(filter); }
public void ForChainsMatching(IChainFilter filter, Action <ValidationNode> action) { addModification(new ValidationNodeModification(filter, action)); }
public ValidationNodeModification(IChainFilter filter, Action<ValidationNode> action) { _filter = filter; _action = action; }
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(); }