Exemplo n.º 1
0
        void GridViewColumnHeader_Click(object sender, RoutedEventArgs e)
        {
            SortGridViewColumnHeader header = sender as SortGridViewColumnHeader;

            if (header == null)
            {
                return;
            }

            if (OrderClick != null && !OrderClick(header.RequestColumn))
            {
                return;
            }

            string canOrder = QueryUtils.CanOrder(header.RequestColumn.Token);

            if (canOrder.HasText())
            {
                //Avoid UI Automation hangs
                Dispatcher.BeginInvoke(() => MessageBox.Show(Window.GetWindow(this), canOrder));

                return;
            }

            header.ChangeOrders(OrderOptions);

            Search(resetPage: true);
        }
Exemplo n.º 2
0
        protected override string?PropertyValidation(PropertyInfo pi)
        {
            if (pi.Name == nameof(Token) && Token != null && Token.ParseException == null)
            {
                return(QueryUtils.CanOrder(Token.Token));
            }

            return(base.PropertyValidation(pi));
        }
Exemplo n.º 3
0
        public static DQueryable <T> OrderBy <T>(this DQueryable <T> query, List <Order> orders)
        {
            string str = orders.Select(f => QueryUtils.CanOrder(f.Token)).NotNull().ToString("\r\n");

            if (str == null)
            {
                throw new ApplicationException(str);
            }

            var pairs = orders.Select(o => Tuple.Create(
                                          Expression.Lambda(OnAddaptForOrderBy(o.Token.BuildExpression(query.Context)), query.Context.Parameter),
                                          o.OrderType)).ToList();

            return(new DQueryable <T>(query.Query.OrderBy(pairs), query.Context));
        }
Exemplo n.º 4
0
        void GridViewColumnHeader_Click(object sender, RoutedEventArgs e)
        {
            SortGridViewColumnHeader header = sender as SortGridViewColumnHeader;

            if (header == null)
            {
                return;
            }

            string canOrder = QueryUtils.CanOrder(header.RequestColumn.Token);

            if (canOrder.HasText())
            {
                MessageBox.Show(Window.GetWindow(this), canOrder);
                return;
            }

            header.ChangeOrders(OrderOptions);

            OnGenerateChart();
        }