示例#1
0
文件: QueryPart.cs 项目: igitur/CQL
 public FieldComparsionViewModel(IValidationScope context, IVariable <Type> field, BinaryOperator?op = null, ComparsionValueViewModel value = null)
 {
     this.KeyDownCommand = new RelayCommand <KeyEventArgs>(args =>
     {
         if (args.Key == Key.Return || args.Key == Key.Enter)
         {
             RequestReadyMode();
         }
     });
     this.context = context;
     this.field   = field;
     this.op      = op;
     this.value   = value;
     this.state   = field == null
         ? FieldComparsionState.Phase1_FieldMissing
         : op == null
             ? FieldComparsionState.Phase2_OperatorMissing
             : value == null
                 ? FieldComparsionState.Phase3_ValueMissing
                 : FieldComparsionState.ReadyToUse;
     ComputePossibleStates();
     UpdateField();
 }
示例#2
0
 public static FilterBoxViewModel NewComparsion(IValidationScope context, bool negate, IVariable <Type> field, BinaryOperator op, ComparsionValueViewModel value)
 {
     return(new FilterBoxViewModel(context, negate, new FieldComparsionViewModel(context, field, op, value))
     {
         state = FilterBoxState.ReadyToUse
     });
 }