This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
/
System.Linq.Expressions.Expression.cs
10376 lines (10251 loc) · 419 KB
/
System.Linq.Expressions.Expression.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// CodeContracts
//
// Copyright (c) Microsoft Corporation
//
// All rights reserved.
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;
using System.Reflection;
using System.Runtime.CompilerServices;
// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108
namespace System.Linq.Expressions
{
// Summary:
// Describes the node types for the nodes of an expression tree.
public enum ExpressionType
{
// Summary:
// A node that represents arithmetic addition without overflow checking.
Add = 0,
//
// Summary:
// A node that represents arithmetic addition with overflow checking.
AddChecked = 1,
//
// Summary:
// A node that represents a bitwise AND operation.
And = 2,
//
// Summary:
// A node that represents a short-circuiting conditional AND operation.
AndAlso = 3,
//
// Summary:
// A node that represents getting the length of a one-dimensional array.
ArrayLength = 4,
//
// Summary:
// A node that represents indexing into a one-dimensional array.
ArrayIndex = 5,
//
// Summary:
// A node that represents a method call.
Call = 6,
//
// Summary:
// A node that represents a null coalescing operation.
Coalesce = 7,
//
// Summary:
// A node that represents a conditional operation.
Conditional = 8,
//
// Summary:
// A node that represents an expression that has a constant value.
Constant = 9,
//
// Summary:
// A node that represents a cast or conversion operation. If the operation is
// a numeric conversion, it overflows silently if the converted value does not
// fit the target type.
Convert = 10,
//
// Summary:
// A node that represents a cast or conversion operation. If the operation is
// a numeric conversion, an exception is thrown if the converted value does
// not fit the target type.
ConvertChecked = 11,
//
// Summary:
// A node that represents arithmetic division.
Divide = 12,
//
// Summary:
// A node that represents an equality comparison.
Equal = 13,
//
// Summary:
// A node that represents a bitwise XOR operation.
ExclusiveOr = 14,
//
// Summary:
// A node that represents a "greater than" numeric comparison.
GreaterThan = 15,
//
// Summary:
// A node that represents a "greater than or equal" numeric comparison.
GreaterThanOrEqual = 16,
//
// Summary:
// A node that represents applying a delegate or lambda expression to a list
// of argument expressions.
Invoke = 17,
//
// Summary:
// A node that represents a lambda expression.
Lambda = 18,
//
// Summary:
// A node that represents a bitwise left-shift operation.
LeftShift = 19,
//
// Summary:
// A node that represents a "less than" numeric comparison.
LessThan = 20,
//
// Summary:
// A node that represents a "less than or equal" numeric comparison.
LessThanOrEqual = 21,
//
// Summary:
// A node that represents creating a new System.Collections.IEnumerable object
// and initializing it from a list of elements.
ListInit = 22,
//
// Summary:
// A node that represents reading from a field or property.
MemberAccess = 23,
//
// Summary:
// A node that represents creating a new object and initializing one or more
// of its members.
MemberInit = 24,
//
// Summary:
// A node that represents an arithmetic remainder operation.
Modulo = 25,
//
// Summary:
// A node that represents arithmetic multiplication without overflow checking.
Multiply = 26,
//
// Summary:
// A node that represents arithmetic multiplication with overflow checking.
MultiplyChecked = 27,
//
// Summary:
// A node that represents an arithmetic negation operation.
Negate = 28,
//
// Summary:
// A node that represents a unary plus operation. The result of a predefined
// unary plus operation is simply the value of the operand, but user-defined
// implementations may have non-trivial results.
UnaryPlus = 29,
//
// Summary:
// A node that represents an arithmetic negation operation that has overflow
// checking.
NegateChecked = 30,
//
// Summary:
// A node that represents calling a constructor to create a new object.
New = 31,
//
// Summary:
// A node that represents creating a new one-dimensional array and initializing
// it from a list of elements.
NewArrayInit = 32,
//
// Summary:
// A node that represents creating a new array where the bounds for each dimension
// are specified.
NewArrayBounds = 33,
//
// Summary:
// A node that represents a bitwise complement operation.
Not = 34,
//
// Summary:
// A node that represents an inequality comparison.
NotEqual = 35,
//
// Summary:
// A node that represents a bitwise OR operation.
Or = 36,
//
// Summary:
// A node that represents a short-circuiting conditional OR operation.
OrElse = 37,
//
// Summary:
// A node that represents a reference to a parameter defined in the context
// of the expression.
Parameter = 38,
//
// Summary:
// A node that represents raising a number to a power.
Power = 39,
//
// Summary:
// A node that represents an expression that has a constant value of type System.Linq.Expressions.Expression.
// A System.Linq.Expressions.ExpressionType.Quote node can contain references
// to parameters defined in the context of the expression it represents.
Quote = 40,
//
// Summary:
// A node that represents a bitwise right-shift operation.
RightShift = 41,
//
// Summary:
// A node that represents arithmetic subtraction without overflow checking.
Subtract = 42,
//
// Summary:
// A node that represents arithmetic subtraction with overflow checking.
SubtractChecked = 43,
//
// Summary:
// A node that represents an explicit reference or boxing conversion where null
// is supplied if the conversion fails.
TypeAs = 44,
//
// Summary:
// A node that represents a type test.
TypeIs = 45,
}
public abstract class Expression
{
protected Expression() { }
// Summary:
// Gets the node type of this System.Linq.Expressions.Expression.
//
// Returns:
// One of the System.Linq.Expressions.ExpressionType values.
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
virtual
#endif
extern public ExpressionType NodeType { get; }
//
// Summary:
// Gets the static type of the expression that this System.Linq.Expressions.Expression
// represents.
//
// Returns:
// The System.Type that represents the static type of the expression.
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
virtual
#endif
public Type Type
{
get
{
Contract.Ensures(Contract.Result<Type>() != null);
return default(Type);
}
}
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
protected internal virtual new System.Linq.Expressions.Expression Accept(ExpressionVisitor visitor)
{
return default(System.Linq.Expressions.Expression);
}
#endif
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
// Reduces the binary expression node to a simpler expression.
//
// Returns:
// The reduced expression.
public virtual Expression Reduce()
{
Contract.Ensures(Contract.Result<Expression>() != null);
return default(Expression);
}
#endif
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
// addition operation that does not have overflow checking.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.Add and the System.Linq.Expressions.BinaryExpression.Left
// and System.Linq.Expressions.BinaryExpression.Right properties set to the
// specified values.
//
// Exceptions:
// System.ArgumentNullException:
// left or right is null.
//
// System.InvalidOperationException:
// The addition operator is not defined for left.Type and right.Type.
[Pure]
public static BinaryExpression Add(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
// addition operation that does not have overflow checking. The implementing
// method can be specified.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.Add and the System.Linq.Expressions.BinaryExpression.Left,
// System.Linq.Expressions.BinaryExpression.Right and System.Linq.Expressions.BinaryExpression.Method
// properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
// left or right is null.
//
// System.ArgumentException:
// method is not null and the method it represents returns void, is not static
// (Shared in Visual Basic), or does not take exactly two arguments.
//
// System.InvalidOperationException:
// method is null and the addition operator is not defined for left.Type and
// right.Type.
[Pure]
public static BinaryExpression Add(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
// assignment operation that does not have overflow checking.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AddAssign and the
// System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
// properties set to the specified values.
[Pure]
public static BinaryExpression AddAssign(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
// assignment operation that does not have overflow checking.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AddAssign and the
// System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
// and System.Linq.Expressions.BinaryExpression.Method properties set to the
// specified values.
[Pure]
public static BinaryExpression AddAssign(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
// assignment operation that does not have overflow checking.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// conversion:
// A System.Linq.Expressions.LambdaExpression to set the System.Linq.Expressions.BinaryExpression.Conversion
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AddAssign and the
// System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
// System.Linq.Expressions.BinaryExpression.Method, and System.Linq.Expressions.BinaryExpression.Conversion
// properties set to the specified values.
[Pure]
public static BinaryExpression AddAssign(Expression left, Expression right, MethodInfo method, LambdaExpression conversion)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
#endif
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
// assignment operation that has overflow checking.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AddAssignChecked
// and the System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
// properties set to the specified values.
[Pure]
public static BinaryExpression AddAssignChecked(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
// assignment operation that has overflow checking.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AddAssignChecked
// and the System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
// and System.Linq.Expressions.BinaryExpression.Method properties set to the
// specified values.
[Pure]
public static BinaryExpression AddAssignChecked(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
// assignment operation that has overflow checking.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// conversion:
// A System.Linq.Expressions.LambdaExpression to set the System.Linq.Expressions.BinaryExpression.Conversion
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AddAssignChecked
// and the System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
// System.Linq.Expressions.BinaryExpression.Method, and System.Linq.Expressions.BinaryExpression.Conversion
// properties set to the specified values.
[Pure]
public static BinaryExpression AddAssignChecked(Expression left, Expression right, MethodInfo method, LambdaExpression conversion)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
#endif
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
// addition operation that has overflow checking.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AddChecked and the
// System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
// properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
// left or right is null.
//
// System.InvalidOperationException:
// The addition operator is not defined for left.Type and right.Type.
[Pure]
public static BinaryExpression AddChecked(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
// addition operation that has overflow checking. The implementing method can
// be specified.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AddChecked and the
// System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right
// and System.Linq.Expressions.BinaryExpression.Method properties set to the
// specified values.
//
// Exceptions:
// System.ArgumentNullException:
// left or right is null.
//
// System.ArgumentException:
// method is not null and the method it represents returns void, is not static
// (Shared in Visual Basic), or does not take exactly two arguments.
//
// System.InvalidOperationException:
// method is null and the addition operator is not defined for left.Type and
// right.Type.
[Pure]
public static BinaryExpression AddChecked(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
// AND operation.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.And and the System.Linq.Expressions.BinaryExpression.Left
// and System.Linq.Expressions.BinaryExpression.Right properties set to the
// specified values.
//
// Exceptions:
// System.ArgumentNullException:
// left or right is null.
//
// System.InvalidOperationException:
// The bitwise AND operator is not defined for left.Type and right.Type.
[Pure]
public static BinaryExpression And(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
// AND operation. The implementing method can be specified.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.And and the System.Linq.Expressions.BinaryExpression.Left,
// System.Linq.Expressions.BinaryExpression.Right, and System.Linq.Expressions.BinaryExpression.Method
// properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
// left or right is null.
//
// System.ArgumentException:
// method is not null and the method it represents returns void, is not static
// (Shared in Visual Basic), or does not take exactly two arguments.
//
// System.InvalidOperationException:
// method is null and the bitwise AND operator is not defined for left.Type
// and right.Type.
[Pure]
public static BinaryExpression And(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents a conditional
// AND operation that evaluates the second operand only if it has to.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AndAlso and the
// System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
// properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
// left or right is null.
//
// System.InvalidOperationException:
// The bitwise AND operator is not defined for left.Type and right.Type. -or-
// left.Type and right.Type are not the same Boolean type.
[Pure]
public static BinaryExpression AndAlso(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents a conditional
// AND operation that evaluates the second operand only if it has to. The implementing
// method can be specified.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AndAlso and the
// System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
// and System.Linq.Expressions.BinaryExpression.Method properties set to the
// specified values.
//
// Exceptions:
// System.ArgumentNullException:
// left or right is null.
//
// System.ArgumentException:
// method is not null and the method it represents returns void, is not static
// (Shared in Visual Basic), or does not take exactly two arguments.
//
// System.InvalidOperationException:
// method is null and the bitwise AND operator is not defined for left.Type
// and right.Type. -or- method is null and left.Type and right.Type are not
// the same Boolean type.
[Pure]
public static BinaryExpression AndAlso(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
// AND assignment operation.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AndAssign and the System.Linq.Expressions.BinaryExpression.Left
// and System.Linq.Expressions.BinaryExpression.Right properties set to the specified
// values.
[Pure]
public static BinaryExpression AndAssign(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
// AND assignment operation.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AndAssign and the System.Linq.Expressions.BinaryExpression.Left,
// System.Linq.Expressions.BinaryExpression.Right, and System.Linq.Expressions.BinaryExpression.Method
// properties set to the specified values.
[Pure]
public static BinaryExpression AndAssign(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
// AND assignment operation.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// method:
// A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
// property equal to.
//
// conversion:
// A System.Linq.Expressions.LambdaExpression to set the System.Linq.Expressions.BinaryExpression.Conversion
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.AndAssign and the System.Linq.Expressions.BinaryExpression.Left,
// System.Linq.Expressions.BinaryExpression.Right, System.Linq.Expressions.BinaryExpression.Method,
// and System.Linq.Expressions.BinaryExpression.Conversion properties set to the
// specified values.
[Pure]
public static BinaryExpression AndAssign(Expression left, Expression right, MethodInfo method, LambdaExpression conversion)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
#endif
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
// Creates an System.Linq.Expressions.IndexExpression to access a multidimensional
// array.
//
// Parameters:
// array:
// An expression that represents the multidimensional array.
//
// indexes:
// An System.Collections.Generic.IEnumerable`1 containing expressions used to index
// the array.
//
// Returns:
// The created System.Linq.Expressions.IndexExpression.
[Pure]
public static IndexExpression ArrayAccess(Expression array, IEnumerable<Expression> indexes)
{
Contract.Requires(array != null);
Contract.Requires(indexes != null);
Contract.Ensures(Contract.Result<IndexExpression>() != null);
return default(IndexExpression);
}
//
// Summary:
// Creates an System.Linq.Expressions.IndexExpression to access an array.
//
// Parameters:
// array:
// An expression representing the array to index.
//
// indexes:
// An array that contains expressions used to index the array.
//
// Returns:
// The created System.Linq.Expressions.IndexExpression.
[Pure]
public static IndexExpression ArrayAccess(Expression array, params Expression[] indexes)
{
Contract.Requires(array != null);
Contract.Requires(indexes != null);
Contract.Requires(indexes.Length >= 1);
Contract.Ensures(Contract.Result<IndexExpression>() != null);
return default(IndexExpression);
}
#endif
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents applying
// an array index operator to an array of rank one.
//
// Parameters:
// array:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
// index:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
// property equal to System.Linq.Expressions.ExpressionType.ArrayIndex and the
// System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
// properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
// array or index is null.
//
// System.ArgumentException:
// array.Type does not represent an array type. -or- array.Type represents
// an array type whose rank is not 1. -or- index.Type does not represent the
// System.Int32 type.
[Pure]
public static BinaryExpression ArrayIndex(Expression array, Expression index)
{
Contract.Requires(array != null);
Contract.Requires(index != null);
Contract.Ensures(Contract.Result<BinaryExpression>() != null);
return default(BinaryExpression);
}
//
// Summary:
// Creates a System.Linq.Expressions.MethodCallExpression that represents applying
// an array index operator to an array of rank more than one.
//