Exemple #1
0
        internal void AddExpression(string expression)
        {
            if (!_regExpression.IsMatch(expression))
            {
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
                                                          "An expression should follow the format: {0}", _regExpressionPatternSimplified));
            }

            _filteringExpressions.Add(expression);

            OnFilteringUpdate?.Invoke();
        }
Exemple #2
0
        internal void RemoveExpression(int index)
        {
            if (index < 0)
            {
                throw new ArgumentException("Expression isn't selected.");
            }

            if (index >= _filteringExpressions.Count)
            {
                throw new ArgumentException("Selection error.");
            }

            _filteringExpressions.RemoveAt(index);

            OnFilteringUpdate?.Invoke();
        }
Exemple #3
0
        internal void EditExpression(int index)
        {
            if (index < 0)
            {
                throw new ArgumentException("Expression isn't selected.");
            }

            if (index >= _filteringExpressions.Count)
            {
                throw new ArgumentException("Selection error.");
            }

            string expression = _filteringExpressions[index];

            _filteringExpressions.RemoveAt(index);

            CurrentFilteringExpression = expression;

            OnFilteringUpdate?.Invoke();
        }