コード例 #1
0
ファイル: CSharpParser.cs プロジェクト: 0xb1dd1e/NRefactory
			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;
			}
コード例 #2
0
ファイル: CSharpParser.cs プロジェクト: N3X15/ILSpy
			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;
			}