public override object Visit(Mono.CSharp.Linq.OrderByAscending orderByAscending) { currentQueryOrderClause = new QueryOrderClause(); var location2 = LocationsBag.GetLocations(orderByAscending.block); if (location2 != null) currentQueryOrderClause.AddChild(new CSharpTokenNode(Convert(location2 [0]), QueryOrderClause.OrderbyKeywordRole), QueryOrderClause.OrderbyKeywordRole); var ordering = new QueryOrdering(); if (orderByAscending.Expr != null) ordering.AddChild((Expression)orderByAscending.Expr.Accept(this), Roles.Expression); var location = LocationsBag.GetLocations(orderByAscending); if (location != null) { ordering.Direction = QueryOrderingDirection.Ascending; ordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.AscendingKeywordRole), QueryOrdering.AscendingKeywordRole); } currentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole); return currentQueryOrderClause; }
public override object Visit(Mono.CSharp.Linq.ThenByDescending thenByDescending) { var ordering = new QueryOrdering(); if (thenByDescending.Expr != null) ordering.AddChild((Expression)thenByDescending.Expr.Accept(this), Roles.Expression); var location = LocationsBag.GetLocations(thenByDescending); if (location != null) { ordering.Direction = QueryOrderingDirection.Descending; ordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole); } currentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole); return null; }
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; }