Ejemplo n.º 1
0
        public CheckerView(OperatorCheckerPair checkerPair)
        {
            if (checkerPair == null)
                return;
            var context = new CheckerViewContext(checkerPair);
            this.DataContext = context;

            InitializeComponent();
            tbParams.MouseLeftButtonDown += (o, e) =>
            {
                context.BeginCheckerUserSettings();
            };

            context.Changed += (o, e) => RaiseChanged();

            btDelete.Click += (o, e) =>
            {
                RaiseRemove();
            };

            this.KeyDown += (o, e) =>
            {
                if (e.Key == Key.Delete)
                {
                    RaiseRemove();
                }
            };
        }
Ejemplo n.º 2
0
        //
        public CheckerViewContext(OperatorCheckerPair operatorCheckerPair)
        {
            _operatorCheckerPair = operatorCheckerPair;

            var checkerString = Helper.CreateParamsViewString(this._operatorCheckerPair.Checker);
            if (!string.IsNullOrWhiteSpace(checkerString))
                this.CheckerString = "(" + checkerString + ")";

            this.ParamsVisibility = this._operatorCheckerPair.Checker.AllowUserSettings ? Visibility.Visible : Visibility.Collapsed;
        }
Ejemplo n.º 3
0
 //
 public ComplexCheckerViewContext(OperatorCheckerPair complexCheckerPair)
 {
     _operatorCheckerPair = complexCheckerPair;
 }
Ejemplo n.º 4
0
 public void RemoveChecker(OperatorCheckerPair pair)
 {
     ((ComplexChecker)_operatorCheckerPair.Checker).OperatorCheckers.Remove(pair);
 }
Ejemplo n.º 5
0
        public OperatorCheckerPair AddGroupChecker()
        {
            if (_operatorCheckerPair == null)
                _operatorCheckerPair = new OperatorCheckerPair();
            if (_operatorCheckerPair.Checker == null)
                _operatorCheckerPair.Checker = new ComplexChecker();

            var checker = new ComplexChecker();

            var pair = new OperatorCheckerPair()
            {
                Checker = checker,
                Operator = Operator.And
            };

            ((ComplexChecker)_operatorCheckerPair.Checker).OperatorCheckers.Add(pair);

            return pair;
        }