Esempio n. 1
0
    static void FinishUp(ref Function oldFunc, OrderFunction currentOrder, string currentMethod, Function newFunc, bool negativeNumber)
    {
        var    realOld      = new Function(oldFunc);
        var    actualMethod = methods.GetFunction(currentMethod);
        double multiplier   = negativeNumber ? -1 : 1;

        oldFunc = (x) => { return(currentOrder.Invoke(realOld(x), actualMethod(newFunc(x * multiplier)))); };
    }
        public void RefreshView()
        {
            // filtering
            var newView = _source.Where(e => IncludedFunction?.Invoke(e) ?? true);

            // sorting
            if (AscendingOrder)
            {
                newView = newView.OrderBy(e => OrderFunction?.Invoke(e));
            }
            else
            {
                newView = newView.OrderByDescending(e => OrderFunction?.Invoke(e));
            }

            _view.Clear();
            _view.AddRange(newView);
            CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
        }