Beispiel #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();
                }
            };
        }
Beispiel #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;
        }
 //
 public ComplexCheckerViewContext(OperatorCheckerPair complexCheckerPair)
 {
     _operatorCheckerPair = complexCheckerPair;
 }
 public void RemoveChecker(OperatorCheckerPair pair)
 {
     ((ComplexChecker)_operatorCheckerPair.Checker).OperatorCheckers.Remove(pair);
 }
        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;
        }