public RemoteRuleGraphActivator(ValidationGraph graph, RemoteRuleGraph remoteGraph, BehaviorGraph behaviorGraph, IRemoteRuleQuery remotes, ITypeDescriptorCache properties)
 {
     _graph = graph;
     _remoteGraph = remoteGraph;
     _behaviorGraph = behaviorGraph;
     _remotes = remotes;
     _properties = properties;
 }
Esempio n. 2
0
        public static ValidationPlan For(Type type, ValidationGraph graph)
        {
            var steps = new List<ValidationStep>();
            graph.Sources.Each(source =>
            {
                var rules = source.RulesFor(type);
                if (!rules.Any()) return;

                steps.Add(new ValidationStep(type, source.GetType(), rules));
            });

            return new ValidationPlan(type, steps);
        }
        public void SetUp()
        {
            theBehaviorGraph = BehaviorGraph.BuildFrom(r =>
            {
                r.Actions.IncludeType<RemoteRuleGraphEndpoint>();
                r.Import<FubuMvcValidation>();
            });

            theValidationGraph = ValidationGraph.BasicGraph();
            theRuleGraph = new RemoteRuleGraph();
            theQuery = RemoteRuleQuery.Basic();

            theActivator = new RemoteRuleGraphActivator(theValidationGraph, theRuleGraph, theBehaviorGraph, theQuery, new TypeDescriptorCache());

            theActivator.Activate(new IPackageInfo[0], new PackageLog());
        }
Esempio n. 4
0
        public static ValidationPlan For(Type type, ValidationGraph graph)
        {
            var steps = new List <ValidationStep>();

            graph.Sources.Each(source =>
            {
                var rules = source.RulesFor(type);
                if (!rules.Any())
                {
                    return;
                }

                steps.Add(new ValidationStep(type, source.GetType(), rules));
            });

            return(new ValidationPlan(type, steps));
        }
 public ValidationRegistrationActivator(ValidationGraph graph)
 {
     _graph = graph;
 }
		public ValidationDiagnostics(ValidationGraph graph)
		{
			_graph = graph;
		}
Esempio n. 7
0
 public Validator(ITypeResolver typeResolver, ValidationGraph graph, IServiceLocator services)
 {
     _typeResolver = typeResolver;
     _graph = graph;
     _services = services;
 }
Esempio n. 8
0
 public static IValidator BasicValidator()
 {
     return(new Validator(new TypeResolver(), ValidationGraph.BasicGraph(), new InMemoryServiceLocator()));
 }
Esempio n. 9
0
 public Validator(ITypeResolver typeResolver, ValidationGraph graph, IServiceLocator services)
 {
     _typeResolver = typeResolver;
     _graph        = graph;
     _services     = services;
 }
 void IValidationRegistration.Register(ValidationGraph graph)
 {
     _rules.Each(r => r.Register(graph.Fields));
     graph.RegisterSource(this);
 }