コード例 #1
0
 public MethodInvocationValidator(ValidationPipe pipe, Func <object, CultureInfo, bool, bool> method,
                                  IErrorStringProvider errorProvider,
                                  IBoolProxy isEnforced, IValueConverter valueConverter, bool strictValidation, bool validatesOnTargetUpdated)
     : base(pipe, errorProvider, isEnforced, valueConverter, strictValidation, validatesOnTargetUpdated)
 {
     this.method = method;
 }
コード例 #2
0
 public NotExistsInValidator(ValidationPipe pipe, IProxy argument, IErrorStringProvider errorProvider,
                             IBoolProxy isEnforced,
                             IValueConverter valueConverter, bool strictValidation, bool validatesOnTargetUpdated)
     : base(pipe, argument, errorProvider, isEnforced, valueConverter, strictValidation,
            validatesOnTargetUpdated)
 {
 }
コード例 #3
0
 protected ComparisonValidator(ValidationPipe pipe, IProxy argument, IErrorStringProvider errorProvider,
                               IBoolProxy isEnforced,
                               IValueConverter valueConverter, bool strictValidation, bool validatesOnTargetUpdated)
     : base(pipe, errorProvider, isEnforced, valueConverter, strictValidation, validatesOnTargetUpdated)
 {
     Argument = argument ?? throw new ArgumentNullException(nameof(argument));
 }
コード例 #4
0
        public ActionElementCommand(IResourceContext context, IValueProvider action, IValueProvider actionParameter, IValueProvider isEnabled, IValueProvider validates, IValueProvider closesDialog, IValueProvider isReset)
        {
            this.context = context;
            this.action  = action?.GetBestMatchingProxy(context) ?? new PlainObject(null);

            switch (isEnabled)
            {
            case LiteralValue v when v.Value is bool b:
                canExecute = new PlainBool(b);
                break;

            case null:
                canExecute = new PlainBool(true);
                break;

            default:
                var proxy = isEnabled.GetBoolValue(context);
                proxy.ValueChanged = () => CanExecuteChanged?.Invoke(this, EventArgs.Empty);
                canExecute         = proxy;
                break;
            }

            this.validates       = validates != null ? (IBoolProxy)validates.GetBoolValue(context) : new PlainBool(false);
            this.closesDialog    = closesDialog != null ? (IBoolProxy)closesDialog.GetBoolValue(context) : new PlainBool(true);
            resets               = isReset != null ? (IBoolProxy)isReset.GetBoolValue(context) : new PlainBool(false);
            this.actionParameter = actionParameter?.GetBestMatchingProxy(context) ?? new PlainObject(null);
        }
コード例 #5
0
 protected FieldValidator(ValidationPipe pipe, IErrorStringProvider errorProvider, IBoolProxy isEnforced,
                          IValueConverter valueConverter, bool strictValidation, bool validatesOnTargetUpdated)
     : base(ValidationStep.ConvertedProposedValue, validatesOnTargetUpdated)
 {
     ValidationPipe   = pipe;
     ErrorProvider    = errorProvider;
     ValueConverter   = valueConverter;
     IsEnforced       = isEnforced;
     StrictValidation = strictValidation;
 }
コード例 #6
0
 public NullValidator(
     ValidationPipe pipe,
     IErrorStringProvider errorProvider,
     IBoolProxy isEnforced,
     IValueConverter valueConverter,
     bool strictValidation,
     bool validatesOnTargetUpdated,
     bool ignoreNullOrEmpty)
     : base(
         pipe,
         errorProvider,
         isEnforced,
         valueConverter,
         strictValidation,
         validatesOnTargetUpdated,
         ignoreNullOrEmpty)
 {
 }
コード例 #7
0
 public FalseValidator(ValidationPipe pipe, IErrorStringProvider errorProvider, IBoolProxy isEnforced,
                       IValueConverter valueConverter,
                       bool strictValidation, bool validatesOnTargetUpdated)
     : base(pipe, errorProvider, isEnforced, valueConverter, strictValidation, validatesOnTargetUpdated)
 {
 }