public override object Visit(Mono.CSharp.Linq.OrderByDescending orderByDescending) { currentQueryOrderClause = new QueryOrderClause(); var ordering = new QueryOrdering(); if (orderByDescending.Expr != null) ordering.AddChild((Expression)orderByDescending.Expr.Accept(this), Roles.Expression); var location = LocationsBag.GetLocations(orderByDescending); if (location != null) { ordering.Direction = QueryOrderingDirection.Descending; ordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole); } currentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole); return currentQueryOrderClause; }
public override object Visit (Mono.CSharp.Linq.ThenByDescending thenByDescending) { var result = new QueryOrderClause (); var ordering = new QueryOrdering (); ordering.AddChild ((Expression)thenByDescending.Expr.Accept (this), QueryWhereClause.Roles.Expression); var location = LocationsBag.GetLocations (thenByDescending); if (location != null) { ordering.Direction = QueryOrderingDirection.Descending; ordering.AddChild (new CSharpTokenNode (Convert (location[0]), "ascending".Length), QueryWhereClause.Roles.Keyword); } result.AddChild (ordering, QueryOrderClause.OrderingRole); return result; }