diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Core.Contracts10.csproj b/Microsoft.Research/Contracts/System.Core.Contracts/System.Core.Contracts10.csproj
index 0a887fca..dd4ea6ca 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Core.Contracts10.csproj
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Core.Contracts10.csproj
@@ -243,6 +243,7 @@
+
diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.BinaryExpression.cs b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.BinaryExpression.cs
index a396bd8d..237000de 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.BinaryExpression.cs
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.BinaryExpression.cs
@@ -99,5 +99,35 @@ public Expression Right
return default(Expression);
}
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a new expression that is like this one, but using the supplied children.
+ // If all of the children are the same, it will return this expression.
+ //
+ // Parameters:
+ // left:
+ // The System.Linq.Expressions.BinaryExpression.Left property of the result.
+ //
+ // conversion:
+ // The System.Linq.Expressions.BinaryExpression.Conversion property of the result.
+ //
+ // right:
+ // The System.Linq.Expressions.BinaryExpression.Right property of the result.
+ //
+ // Returns:
+ // This expression if no children are changed or an expression with the updated
+ // children.
+ [Pure]
+ public BinaryExpression Update(Expression left, LambdaExpression conversion, Expression right)
+ {
+ Contract.Requires(left != null);
+ Contract.Requires(right != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(BinaryExpression);
+ }
+#endif
+
}
}
diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.BlockExpression.cs b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.BlockExpression.cs
index 04c01101..f99169b3 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.BlockExpression.cs
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.BlockExpression.cs
@@ -40,6 +40,7 @@ public ReadOnlyCollection Expressions
get
{
Contract.Ensures(Contract.Result>() != null);
+ Contract.Ensures(Contract.Result>().Count >= 1);
return default(ReadOnlyCollection);
}
}
@@ -135,9 +136,9 @@ protected internal override Expression Accept(ExpressionVisitor visitor)
// Returns:
// This expression if no children changed, or an expression with the updated
// children.
+ [Pure]
public BlockExpression Update(IEnumerable variables, IEnumerable expressions)
{
- Contract.Requires(variables != null);
Contract.Requires(expressions != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.CatchBlock.cs b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.CatchBlock.cs
index 4ca28157..75f17465 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.CatchBlock.cs
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.CatchBlock.cs
@@ -42,8 +42,11 @@ sealed public partial class CatchBlock {
#region Methods and constructors
private CatchBlock() {}
+ [Pure]
public CatchBlock Update(ParameterExpression variable, Expression filter, Expression body)
{
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
return default(CatchBlock);
}
#endregion
@@ -53,6 +56,7 @@ public Expression Body
{
get
{
+ Contract.Ensures(Contract.Result() != null);
return default(Expression);
}
}
@@ -69,6 +73,7 @@ public Type Test
{
get
{
+ Contract.Ensures(Contract.Result() != null);
return default(Type);
}
}
diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.ConditionalExpression.cs b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.ConditionalExpression.cs
index 3f3fceac..db11bcec 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.ConditionalExpression.cs
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.ConditionalExpression.cs
@@ -68,5 +68,34 @@ public Expression Test
return default(Expression);
}
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a new expression that is like this one, but using the supplied children.
+ // If all of the children are the same, it will return this expression
+ //
+ // Parameters:
+ // test:
+ // The System.Linq.Expressions.ConditionalExpression.Test property of the result.
+ //
+ // ifTrue:
+ // The System.Linq.Expressions.ConditionalExpression.IfTrue property of the result.
+ //
+ // ifFalse:
+ // The System.Linq.Expressions.ConditionalExpression.IfFalse property of the result.
+ //
+ // Returns:
+ // This expression if no children changed, or an expression with the updated children.
+ [Pure]
+ public ConditionalExpression Update(Expression test, Expression ifTrue, Expression ifFalse)
+ {
+ Contract.Requires(test != null);
+ Contract.Requires(ifTrue != null);
+ Contract.Requires(ifFalse != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ConditionalExpression);
+ }
+#endif
}
}
diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.DebugInfoExpression.cs b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.DebugInfoExpression.cs
index 7a3775f3..7bd55238 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.DebugInfoExpression.cs
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.DebugInfoExpression.cs
@@ -55,6 +55,7 @@ public SymbolDocumentInfo Document
{
get
{
+ Contract.Ensures(Contract.Result() != null);
return default(SymbolDocumentInfo);
}
}
diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.DynamicExpression.cs b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.DynamicExpression.cs
index 2f33c6a5..e82b0833 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.DynamicExpression.cs
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.DynamicExpression.cs
@@ -15,11 +15,13 @@
#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
// File System.Linq.Expressions.DynamicExpression.cs
// Automatically generated contract file.
+using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Diagnostics.Contracts;
using System.IO;
+using System.Runtime.CompilerServices;
using System.Text;
-using System.Diagnostics.Contracts;
-using System;
// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
@@ -49,34 +51,39 @@ protected internal override Expression Accept (ExpressionVisitor visitor)
return default(Expression);
}
+ [Pure]
public DynamicExpression Update (IEnumerable arguments)
{
+ Contract.Ensures(Contract.Result() != null);
return default(DynamicExpression);
}
#endregion
#region Properties and indexers
- public System.Collections.ObjectModel.ReadOnlyCollection Arguments
+ public ReadOnlyCollection Arguments
{
get
{
- return default(System.Collections.ObjectModel.ReadOnlyCollection);
+ Contract.Ensures(Contract.Result>() != null);
+ return default(ReadOnlyCollection);
}
}
- public System.Runtime.CompilerServices.CallSiteBinder Binder
+ public CallSiteBinder Binder
{
get
{
- return default(System.Runtime.CompilerServices.CallSiteBinder);
+ Contract.Ensures(Contract.Result() != null);
+ return default(CallSiteBinder);
}
}
- public System.Type DelegateType
+ public Type DelegateType
{
get
{
- return default(System.Type);
+ Contract.Ensures(Contract.Result() != null);
+ return default(Type);
}
}
diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.ElementInit.cs b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.ElementInit.cs
index a08f06bc..24341ca6 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.ElementInit.cs
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.ElementInit.cs
@@ -13,10 +13,11 @@
// 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.Collections.ObjectModel;
+using System.Diagnostics.Contracts;
using System.Reflection;
using System.Text;
-using System.Diagnostics.Contracts;
namespace System.Linq.Expressions
{
@@ -56,9 +57,31 @@ public ReadOnlyCollection Arguments
get
{
Contract.Ensures(Contract.Result>() != null);
+ Contract.Ensures(Contract.Result>().Count >= 1);
return default(ReadOnlyCollection);
}
}
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a new expression that is like this one, but using the supplied children.
+ // If all of the children are the same, it will return this expression.
+ //
+ // Parameters:
+ // arguments:
+ // The System.Linq.Expressions.ElementInit.Arguments property of the result.
+ //
+ // Returns:
+ // This expression if no children are changed or an expression with the updated
+ // children.
+ [Pure]
+ public ElementInit Update(IEnumerable arguments)
+ {
+ Contract.Requires(arguments != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ElementInit);
+ }
+#endif
}
-}
+}
\ No newline at end of file
diff --git a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.Expression.cs b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.Expression.cs
index 0b1ea971..56590f7b 100644
--- a/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.Expression.cs
+++ b/Microsoft.Research/Contracts/System.Core.Contracts/System.Linq.Expressions.Expression.cs
@@ -18,6 +18,7 @@
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
@@ -282,6 +283,19 @@ public Type Type
}
#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() != null);
+ return default(Expression);
+ }
+#endif
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
@@ -317,7 +331,6 @@ public static BinaryExpression Add(Expression left, Expression right)
Contract.Ensures(Contract.Result() != null);
return default(BinaryExpression);
}
-
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
@@ -363,7 +376,7 @@ public static BinaryExpression Add(Expression left, Expression right, MethodInfo
return default(BinaryExpression);
}
-#if !SILVERLIGHT_3_0 && !NETFRAMEWORK_3_5
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
@@ -383,6 +396,7 @@ public static BinaryExpression Add(Expression left, Expression right, MethodInfo
// 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);
@@ -390,7 +404,6 @@ public static BinaryExpression AddAssign(Expression left, Expression right)
Contract.Ensures(Contract.Result() != null);
return default(BinaryExpression);
}
-
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
@@ -415,6 +428,7 @@ public static BinaryExpression AddAssign(Expression left, Expression right)
// 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);
@@ -450,6 +464,7 @@ public static BinaryExpression AddAssign(Expression left, Expression right, Meth
// 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);
@@ -457,6 +472,9 @@ public static BinaryExpression AddAssign(Expression left, Expression right, Meth
Contract.Ensures(Contract.Result() != 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
@@ -476,6 +494,7 @@ public static BinaryExpression AddAssign(Expression left, Expression right, Meth
// 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);
@@ -507,6 +526,7 @@ public static BinaryExpression AddAssignChecked(Expression left, Expression righ
// 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);
@@ -514,7 +534,6 @@ public static BinaryExpression AddAssignChecked(Expression left, Expression righ
Contract.Ensures(Contract.Result() != null);
return default(BinaryExpression);
}
-
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents an addition
@@ -543,6 +562,7 @@ public static BinaryExpression AddAssignChecked(Expression left, Expression righ
// 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);
@@ -709,6 +729,7 @@ public static BinaryExpression And(Expression left, Expression right, MethodInfo
Contract.Ensures(Contract.Result() != null);
return default(BinaryExpression);
}
+
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents a conditional
@@ -790,6 +811,152 @@ public static BinaryExpression AndAlso(Expression left, Expression right, Method
Contract.Ensures(Contract.Result() != 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() != 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() != 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() != 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 indexes)
+ {
+ Contract.Requires(array != null);
+ Contract.Requires(indexes != null);
+ Contract.Ensures(Contract.Result() != 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() != null);
+ return default(IndexExpression);
+ }
+#endif
+
//
// Summary:
// Creates a System.Linq.Expressions.BinaryExpression that represents applying
@@ -898,9 +1065,11 @@ public static MethodCallExpression ArrayIndex(Expression array, params Expressio
{
Contract.Requires(array != null);
Contract.Requires(indexes != null);
+ Contract.Requires(indexes.Length >= 1);
Contract.Ensures(Contract.Result() != null);
return default(MethodCallExpression);
}
+
//
// Summary:
// Creates a System.Linq.Expressions.UnaryExpression that represents getting
@@ -929,6 +1098,37 @@ public static UnaryExpression ArrayLength(Expression array)
Contract.Ensures(Contract.Result() != null);
return default(UnaryExpression);
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.BinaryExpression that represents an 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.Assign and the System.Linq.Expressions.BinaryExpression.Left
+ // and System.Linq.Expressions.BinaryExpression.Right properties set to the specified
+ // values.
+ [Pure]
+ public static BinaryExpression Assign(Expression left, Expression right)
+ {
+ Contract.Requires(left != null);
+ Contract.Requires(right != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(BinaryExpression);
+ }
+#endif
+
//
// Summary:
// Creates a System.Linq.Expressions.MemberAssignment that represents the initialization
@@ -1002,7 +1202,8 @@ public static MemberAssignment Bind(MethodInfo propertyAccessor, Expression expr
Contract.Ensures(Contract.Result() != null);
return default(MemberAssignment);
}
-#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
// Creates a System.Linq.Expressions.BlockExpression that contains the given
@@ -1014,8 +1215,10 @@ public static MemberAssignment Bind(MethodInfo propertyAccessor, Expression expr
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(IEnumerable expressions)
{
+ Contract.Requires(expressions != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1030,8 +1233,11 @@ public static BlockExpression Block(IEnumerable expressions)
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(params Expression[] expressions)
{
+ Contract.Requires(expressions != null);
+ Contract.Requires(expressions.Length >= 1);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1049,8 +1255,11 @@ public static BlockExpression Block(params Expression[] expressions)
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(Expression arg0, Expression arg1)
{
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1068,8 +1277,10 @@ public static BlockExpression Block(Expression arg0, Expression arg1)
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(IEnumerable variables, IEnumerable expressions)
{
+ Contract.Requires(expressions != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1087,8 +1298,11 @@ public static BlockExpression Block(IEnumerable variables,
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(IEnumerable variables, params Expression[] expressions)
{
+ Contract.Requires(expressions != null);
+ Contract.Requires(expressions.Length >= 1);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1106,8 +1320,11 @@ public static BlockExpression Block(IEnumerable variables,
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(Type type, IEnumerable expressions)
{
+ Contract.Requires(type != null);
+ Contract.Requires(expressions != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1125,8 +1342,12 @@ public static BlockExpression Block(Type type, IEnumerable expressio
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(Type type, params Expression[] expressions)
{
+ Contract.Requires(type != null);
+ Contract.Requires(expressions != null);
+ Contract.Requires(expressions.Length >= 1);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1147,8 +1368,12 @@ public static BlockExpression Block(Type type, params Expression[] expressions)
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(Expression arg0, Expression arg1, Expression arg2)
{
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1169,8 +1394,11 @@ public static BlockExpression Block(Expression arg0, Expression arg1, Expression
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(Type type, IEnumerable variables, IEnumerable expressions)
{
+ Contract.Requires(type != null);
+ Contract.Requires(expressions != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1191,8 +1419,12 @@ public static BlockExpression Block(Type type, IEnumerable
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(Type type, IEnumerable variables, params Expression[] expressions)
{
+ Contract.Requires(type != null);
+ Contract.Requires(expressions != null);
+ Contract.Requires(expressions.Length >= 1);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1216,8 +1448,13 @@ public static BlockExpression Block(Type type, IEnumerable
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(Expression arg0, Expression arg1, Expression arg2, Expression arg3)
{
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
+ Contract.Requires(arg3 != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
@@ -1244,12 +1481,120 @@ public static BlockExpression Block(Expression arg0, Expression arg1, Expression
//
// Returns:
// The created System.Linq.Expressions.BlockExpression.
+ [Pure]
public static BlockExpression Block(Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression arg4)
{
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
+ Contract.Requires(arg3 != null);
+ Contract.Requires(arg4 != null);
Contract.Ensures(Contract.Result() != null);
return default(BlockExpression);
}
#endif
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a break statement.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Break, the System.Linq.Expressions.GotoExpression.Target property set
+ // to target, and a null value to be passed to the target label upon jumping.
+ [Pure]
+ public static GotoExpression Break(LabelTarget target)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a break statement
+ // with the specified type.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
+ //
+ // type:
+ // An System.Type to set the System.Linq.Expressions.Expression.Type property equal
+ // to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Break, the System.Linq.Expressions.GotoExpression.Target property set
+ // to target, and the System.Linq.Expressions.Expression.Type property set to type.
+ [Pure]
+ public static GotoExpression Break(LabelTarget target, Type type)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a break statement.
+ // The value passed to the label upon jumping can be specified.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
+ //
+ // value:
+ // The value that will be passed to the associated label upon jumping.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Break, the System.Linq.Expressions.GotoExpression.Target property set
+ // to target, and value to be passed to the target label upon jumping.
+ [Pure]
+ public static GotoExpression Break(LabelTarget target, Expression value)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a break statement
+ // with the specified type. The value passed to the label upon jumping can be specified.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
+ //
+ // value:
+ // The value that will be passed to the associated label upon jumping.
+ //
+ // type:
+ // An System.Type to set the System.Linq.Expressions.Expression.Type property equal
+ // to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Break, the System.Linq.Expressions.GotoExpression.Target property set
+ // to target, the System.Linq.Expressions.Expression.Type property set to type,
+ // and value to be passed to the target label upon jumping.
+ [Pure]
+ public static GotoExpression Break(LabelTarget target, Expression value, Type type)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
+#endif
+
//
// Summary:
// Creates a System.Linq.Expressions.MethodCallExpression that represents a
@@ -1499,386 +1844,448 @@ public static MethodCallExpression Call(Type type, string methodName, Type[] typ
Contract.Ensures(Contract.Result() != null);
return default(MethodCallExpression);
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a coalescing
- // operation.
+ // Creates a System.Linq.Expressions.MethodCallExpression that represents a call
+ // to a static (Shared in Visual Basic) method.
//
// Parameters:
- // left:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
- // property equal to.
+ // method:
+ // The System.Reflection.MethodInfo that represents the target method.
//
- // right:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
- // property equal to.
+ // arguments:
+ // A collection of System.Linq.Expressions.Expression that represents the call arguments.
//
// Returns:
- // A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Coalesce 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 System.Linq.Expressions.Expression.Type property of left does not represent
- // a reference type or a nullable value type.
- //
- // System.ArgumentException:
- // left.Type and right.Type are not convertible to each other.
+ // A System.Linq.Expressions.MethodCallExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Call and the System.Linq.Expressions.MethodCallExpression.Object
+ // and System.Linq.Expressions.MethodCallExpression.Method properties set to the
+ // specified values.
[Pure]
- public static BinaryExpression Coalesce(Expression left, Expression right)
+ public static MethodCallExpression Call(MethodInfo method, IEnumerable arguments)
{
- Contract.Requires(left != null);
- Contract.Requires(right != null);
- Contract.Ensures(Contract.Result() != null);
- return default(BinaryExpression);
+ Contract.Requires(method != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MethodCallExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a coalescing
- // operation, given a conversion function.
+ // Creates a System.Linq.Expressions.MethodCallExpression that represents a call
+ // to a static (Shared in Visual Basic) method that takes one argument.
//
// 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
+ // method:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.MethodCallExpression.Method
// property equal to.
//
- // conversion:
- // A System.Linq.Expressions.LambdaExpression to set the System.Linq.Expressions.BinaryExpression.Conversion
- // property equal to.
+ // arg0:
+ // The System.Linq.Expressions.Expression that represents the first argument.
//
// Returns:
- // A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Coalesce and the
- // System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right
- // and System.Linq.Expressions.BinaryExpression.Conversion properties set to
- // the specified values.
+ // A System.Linq.Expressions.MethodCallExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Call and the System.Linq.Expressions.MethodCallExpression.Object
+ // and System.Linq.Expressions.MethodCallExpression.Method properties set to the
+ // specified values.
//
// Exceptions:
- // System.ArgumentNullException:
- // left or right is null.
- //
- // System.ArgumentException:
- // left.Type and right.Type are not convertible to each other. -or- conversion
- // is not null and conversion.Type is a delegate type that does not take exactly
- // one argument.
- //
- // System.InvalidOperationException:
- // The System.Linq.Expressions.Expression.Type property of left does not represent
- // a reference type or a nullable value type. -or- The System.Linq.Expressions.Expression.Type
- // property of left represents a type that is not assignable to the parameter
- // type of the delegate type conversion.Type. -or- The System.Linq.Expressions.Expression.Type
- // property of right is not equal to the return type of the delegate type conversion.Type.
+ // T:System.ArgumentNullException:
+ // method is null.
[Pure]
- public static BinaryExpression Coalesce(Expression left, Expression right, LambdaExpression conversion)
+ public static MethodCallExpression Call(MethodInfo method, Expression arg0)
{
- Contract.Requires(left != null);
- Contract.Requires(right != null);
- Contract.Ensures(Contract.Result() != null);
- return default(BinaryExpression);
+ Contract.Requires(method != null);
+ Contract.Requires(arg0 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MethodCallExpression);
}
-
//
// Summary:
- // Creates a System.Linq.Expressions.ConditionalExpression.
+ // Creates a System.Linq.Expressions.MethodCallExpression that represents a call
+ // to a static method that takes two arguments.
//
// Parameters:
- // test:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.Test
+ // method:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.MethodCallExpression.Method
// property equal to.
//
- // ifTrue:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfTrue
- // property equal to.
+ // arg0:
+ // The System.Linq.Expressions.Expression that represents the first argument.
//
- // ifFalse:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfFalse
- // property equal to.
+ // arg1:
+ // The System.Linq.Expressions.Expression that represents the second argument.
//
// Returns:
- // A System.Linq.Expressions.ConditionalExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Conditional and
- // the System.Linq.Expressions.ConditionalExpression.Test, System.Linq.Expressions.ConditionalExpression.IfTrue,
- // and System.Linq.Expressions.ConditionalExpression.IfFalse properties set
- // to the specified values.
+ // A System.Linq.Expressions.MethodCallExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Call and the System.Linq.Expressions.MethodCallExpression.Object
+ // and System.Linq.Expressions.MethodCallExpression.Method properties set to the
+ // specified values.
//
// Exceptions:
- // System.ArgumentNullException:
- // test or ifTrue or ifFalse is null.
- //
- // System.ArgumentException:
- // test.Type is not System.Boolean. -or- ifTrue.Type is not equal to ifFalse.Type.
+ // T:System.ArgumentNullException:
+ // method is null.
[Pure]
- public static ConditionalExpression Condition(Expression test, Expression ifTrue, Expression ifFalse)
+ public static MethodCallExpression Call(MethodInfo method, Expression arg0, Expression arg1)
{
- Contract.Requires(test != null);
- Contract.Requires(ifTrue != null);
- Contract.Requires(ifFalse != null);
- Contract.Ensures(Contract.Result() != null);
- return default(ConditionalExpression);
+ Contract.Requires(method != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MethodCallExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.ConstantExpression that has the System.Linq.Expressions.ConstantExpression.Value
- // property set to the specified value.
+ // Creates a System.Linq.Expressions.MethodCallExpression that represents a call
+ // to a method that takes two arguments.
//
// Parameters:
- // value:
- // An System.Object to set the System.Linq.Expressions.ConstantExpression.Value
- // property equal to.
+ // instance:
+ // An System.Linq.Expressions.Expression that specifies the instance for an instance
+ // call. (pass null for a static (Shared in Visual Basic) method).
+ //
+ // method:
+ // The System.Reflection.MethodInfo that represents the target method.
+ //
+ // arg0:
+ // The System.Linq.Expressions.Expression that represents the first argument.
+ //
+ // arg1:
+ // The System.Linq.Expressions.Expression that represents the second argument.
//
// Returns:
- // A System.Linq.Expressions.ConstantExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Constant and the
- // System.Linq.Expressions.ConstantExpression.Value property set to the specified
- // value.
+ // A System.Linq.Expressions.MethodCallExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Call and the System.Linq.Expressions.MethodCallExpression.Object
+ // and System.Linq.Expressions.MethodCallExpression.Method properties set to the
+ // specified values.
[Pure]
- public static ConstantExpression Constant(object value)
+ public static MethodCallExpression Call(Expression instance, MethodInfo method, Expression arg0, Expression arg1)
{
- Contract.Ensures(Contract.Result() != null);
- return default(ConstantExpression);
+ Contract.Requires(method != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MethodCallExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.ConstantExpression that has the System.Linq.Expressions.ConstantExpression.Value
- // and System.Linq.Expressions.Expression.Type properties set to the specified
- // values.
+ // Creates a System.Linq.Expressions.MethodCallExpression that represents a call
+ // to a static method that takes three arguments.
//
// Parameters:
- // value:
- // An System.Object to set the System.Linq.Expressions.ConstantExpression.Value
+ // method:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.MethodCallExpression.Method
// property equal to.
//
- // type:
- // A System.Type to set the System.Linq.Expressions.Expression.Type property
- // equal to.
+ // arg0:
+ // The System.Linq.Expressions.Expression that represents the first argument.
+ //
+ // arg1:
+ // The System.Linq.Expressions.Expression that represents the second argument.
+ //
+ // arg2:
+ // The System.Linq.Expressions.Expression that represents the third argument.
//
// Returns:
- // A System.Linq.Expressions.ConstantExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Constant and the
- // System.Linq.Expressions.ConstantExpression.Value and System.Linq.Expressions.Expression.Type
- // properties set to the specified values.
+ // A System.Linq.Expressions.MethodCallExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Call and the System.Linq.Expressions.MethodCallExpression.Object
+ // and System.Linq.Expressions.MethodCallExpression.Method properties set to the
+ // specified values.
//
// Exceptions:
- // System.ArgumentNullException:
- // type is null.
- //
- // System.ArgumentException:
- // value is not null and type is not assignable from the dynamic type of value.
+ // T:System.ArgumentNullException:
+ // method is null.
[Pure]
- public static ConstantExpression Constant(object value, Type type)
+ public static MethodCallExpression Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2)
{
- Contract.Requires(type != null);
- Contract.Ensures(Contract.Result() != null);
- return default(ConstantExpression);
+ Contract.Requires(method != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MethodCallExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.UnaryExpression that represents a conversion
- // operation.
+ // Creates a System.Linq.Expressions.MethodCallExpression that represents a call
+ // to a method that takes three arguments.
//
// Parameters:
- // expression:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.UnaryExpression.Operand
- // property equal to.
+ // instance:
+ // An System.Linq.Expressions.Expression that specifies the instance for an instance
+ // call. (pass null for a static (Shared in Visual Basic) method).
//
- // type:
- // A System.Type to set the System.Linq.Expressions.Expression.Type property
- // equal to.
+ // method:
+ // The System.Reflection.MethodInfo that represents the target method.
//
- // Returns:
- // A System.Linq.Expressions.UnaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Convert and the
- // System.Linq.Expressions.UnaryExpression.Operand and System.Linq.Expressions.Expression.Type
- // properties set to the specified values.
+ // arg0:
+ // The System.Linq.Expressions.Expression that represents the first argument.
//
- // Exceptions:
- // System.ArgumentNullException:
- // expression or type is null.
+ // arg1:
+ // The System.Linq.Expressions.Expression that represents the second argument.
//
- // System.InvalidOperationException:
- // No conversion operator is defined between expression.Type and type.
+ // arg2:
+ // The System.Linq.Expressions.Expression that represents the third argument.
+ //
+ // Returns:
+ // A System.Linq.Expressions.MethodCallExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Call and the System.Linq.Expressions.MethodCallExpression.Object
+ // and System.Linq.Expressions.MethodCallExpression.Method properties set to the
+ // specified values.
[Pure]
- public static UnaryExpression Convert(Expression expression, Type type)
+ public static MethodCallExpression Call(Expression instance, MethodInfo method, Expression arg0, Expression arg1, Expression arg2)
{
- Contract.Requires(expression != null);
- Contract.Requires(type != null);
- Contract.Ensures(Contract.Result() != null);
- return default(UnaryExpression);
+ Contract.Requires(method != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MethodCallExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.UnaryExpression that represents a conversion
- // operation for which the implementing method is specified.
+ // Creates a System.Linq.Expressions.MethodCallExpression that represents a call
+ // to a static method that takes four arguments.
//
// Parameters:
- // expression:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.UnaryExpression.Operand
+ // method:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.MethodCallExpression.Method
// property equal to.
//
- // type:
- // A System.Type to set the System.Linq.Expressions.Expression.Type property
- // equal to.
+ // arg0:
+ // The System.Linq.Expressions.Expression that represents the first argument.
//
- // method:
- // A System.Reflection.MethodInfo to set the System.Linq.Expressions.UnaryExpression.Method
- // property equal to.
+ // arg1:
+ // The System.Linq.Expressions.Expression that represents the second argument.
+ //
+ // arg2:
+ // The System.Linq.Expressions.Expression that represents the third argument.
+ //
+ // arg3:
+ // The System.Linq.Expressions.Expression that represents the fourth argument.
//
// Returns:
- // A System.Linq.Expressions.UnaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Convert and the
- // System.Linq.Expressions.UnaryExpression.Operand, System.Linq.Expressions.Expression.Type,
- // and System.Linq.Expressions.UnaryExpression.Method properties set to the
+ // A System.Linq.Expressions.MethodCallExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Call and the System.Linq.Expressions.MethodCallExpression.Object
+ // and System.Linq.Expressions.MethodCallExpression.Method properties set to the
// specified values.
//
// Exceptions:
- // System.ArgumentNullException:
- // expression or type 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 one argument.
- //
- // System.Reflection.AmbiguousMatchException:
- // More than one method that matches the method description was found.
- //
- // System.InvalidOperationException:
- // No conversion operator is defined between expression.Type and type. -or-
- // expression.Type is not assignable to the argument type of the method represented
- // by method. -or- The return type of the method represented by method is not
- // assignable to type. -or- expression.Type or type is a nullable value type
- // and the corresponding non-nullable value type does not equal the argument
- // type or the return type, respectively, of the method represented by method.
+ // T:System.ArgumentNullException:
+ // method is null.
[Pure]
- public static UnaryExpression Convert(Expression expression, Type type, MethodInfo method)
+ public static MethodCallExpression Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
{
- Contract.Requires(expression != null);
- Contract.Requires(type != null);
- Contract.Ensures(Contract.Result() != null);
- return default(UnaryExpression);
+ Contract.Requires(method != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
+ Contract.Requires(arg3 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MethodCallExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.UnaryExpression that represents a conversion
- // operation that throws an exception if the target type is overflowed.
+ // Creates a System.Linq.Expressions.MethodCallExpression that represents a call
+ // to a static method that takes five arguments.
//
// Parameters:
- // expression:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.UnaryExpression.Operand
+ // method:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.MethodCallExpression.Method
// property equal to.
//
- // type:
- // A System.Type to set the System.Linq.Expressions.Expression.Type property
- // equal to.
+ // arg0:
+ // The System.Linq.Expressions.Expression that represents the first argument.
//
- // Returns:
- // A System.Linq.Expressions.UnaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.ConvertChecked and
- // the System.Linq.Expressions.UnaryExpression.Operand and System.Linq.Expressions.Expression.Type
- // properties set to the specified values.
+ // arg1:
+ // The System.Linq.Expressions.Expression that represents the second argument.
+ //
+ // arg2:
+ // The System.Linq.Expressions.Expression that represents the third argument.
+ //
+ // arg3:
+ // The System.Linq.Expressions.Expression that represents the fourth argument.
+ //
+ // arg4:
+ // The System.Linq.Expressions.Expression that represents the fifth argument.
+ //
+ // Returns:
+ // A System.Linq.Expressions.MethodCallExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Call and the System.Linq.Expressions.MethodCallExpression.Object
+ // and System.Linq.Expressions.MethodCallExpression.Method properties set to the
+ // specified values.
//
// Exceptions:
- // System.ArgumentNullException:
- // expression or type is null.
+ // T:System.ArgumentNullException:
+ // method is null.
+ [Pure]
+ public static MethodCallExpression Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression arg4)
+ {
+ Contract.Requires(method != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
+ Contract.Requires(arg3 != null);
+ Contract.Requires(arg4 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MethodCallExpression);
+ }
+#endif
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
- // System.InvalidOperationException:
- // No conversion operator is defined between expression.Type and type.
+ // Summary:
+ // Creates a System.Linq.Expressions.CatchBlock representing a catch statement with
+ // a reference to the caught System.Exception object for use in the handler body.
+ //
+ // Parameters:
+ // variable:
+ // A System.Linq.Expressions.ParameterExpression representing a reference to the
+ // System.Exception object caught by this handler.
+ //
+ // body:
+ // The body of the catch statement.
+ //
+ // Returns:
+ // The created System.Linq.Expressions.CatchBlock.
[Pure]
- public static UnaryExpression ConvertChecked(Expression expression, Type type)
+ public static CatchBlock Catch(ParameterExpression variable, Expression body)
+ {
+ Contract.Requires(variable != null);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(CatchBlock);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.CatchBlock representing a catch statement.
+ //
+ // Parameters:
+ // type:
+ // The System.Linq.Expressions.Expression.Type of System.Exception this System.Linq.Expressions.CatchBlock
+ // will handle.
+ //
+ // body:
+ // The body of the catch statement.
+ //
+ // Returns:
+ // The created System.Linq.Expressions.CatchBlock.
+ [Pure]
+ public static CatchBlock Catch(Type type, Expression body)
{
- Contract.Requires(expression != null);
Contract.Requires(type != null);
- Contract.Ensures(Contract.Result() != null);
- return default(UnaryExpression);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(CatchBlock);
}
//
// Summary:
- // Creates a System.Linq.Expressions.UnaryExpression that represents a conversion
- // operation that throws an exception if the target type is overflowed and for
- // which the implementing method is specified.
+ // Creates a System.Linq.Expressions.CatchBlock representing a catch statement with
+ // an System.Exception filter and a reference to the caught System.Exception object.
//
// Parameters:
- // expression:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.UnaryExpression.Operand
- // property equal to.
+ // variable:
+ // A System.Linq.Expressions.ParameterExpression representing a reference to the
+ // System.Exception object caught by this handler.
//
- // type:
- // A System.Type to set the System.Linq.Expressions.Expression.Type property
- // equal to.
+ // body:
+ // The body of the catch statement.
//
- // method:
- // A System.Reflection.MethodInfo to set the System.Linq.Expressions.UnaryExpression.Method
- // property equal to.
+ // filter:
+ // The body of the System.Exception filter.
//
// Returns:
- // A System.Linq.Expressions.UnaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.ConvertChecked and
- // the System.Linq.Expressions.UnaryExpression.Operand, System.Linq.Expressions.Expression.Type,
- // and System.Linq.Expressions.UnaryExpression.Method properties set to the
- // specified values.
+ // The created System.Linq.Expressions.CatchBlock.
+ [Pure]
+ public static CatchBlock Catch(ParameterExpression variable, Expression body, Expression filter)
+ {
+ Contract.Requires(variable != null);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(CatchBlock);
+ }
//
- // Exceptions:
- // System.ArgumentNullException:
- // expression or type is null.
+ // Summary:
+ // Creates a System.Linq.Expressions.CatchBlock representing a catch statement with
+ // an System.Exception filter but no reference to the caught System.Exception object.
//
- // 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 one argument.
+ // Parameters:
+ // type:
+ // The System.Linq.Expressions.Expression.Type of System.Exception this System.Linq.Expressions.CatchBlock
+ // will handle.
//
- // System.Reflection.AmbiguousMatchException:
- // More than one method that matches the method description was found.
+ // body:
+ // The body of the catch statement.
//
- // System.InvalidOperationException:
- // No conversion operator is defined between expression.Type and type. -or-
- // expression.Type is not assignable to the argument type of the method represented
- // by method. -or- The return type of the method represented by method is not
- // assignable to type. -or- expression.Type or type is a nullable value type
- // and the corresponding non-nullable value type does not equal the argument
- // type or the return type, respectively, of the method represented by method.
+ // filter:
+ // The body of the System.Exception filter.
+ //
+ // Returns:
+ // The created System.Linq.Expressions.CatchBlock.
[Pure]
- public static UnaryExpression ConvertChecked(Expression expression, Type type, MethodInfo method)
+ public static CatchBlock Catch(Type type, Expression body, Expression filter)
{
- Contract.Requires(expression != null);
Contract.Requires(type != null);
- Contract.Ensures(Contract.Result() != null);
- return default(UnaryExpression);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(CatchBlock);
}
+#endif
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
- // division operation.
+ // Creates a System.Linq.Expressions.DebugInfoExpression for clearing a sequence
+ // point.
+ //
+ // Parameters:
+ // document:
+ // The System.Linq.Expressions.SymbolDocumentInfo that represents the source file.
+ //
+ // Returns:
+ // An instance of System.Linq.Expressions.DebugInfoExpression for clearing a sequence
+ // point.
+ [Pure]
+ public static DebugInfoExpression ClearDebugInfo(SymbolDocumentInfo document)
+ {
+ Contract.Requires(document != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DebugInfoExpression);
+ }
+#endif
+
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a coalescing
+ // operation.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
- // property to.
+ // property equal to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
- // property to.
+ // property equal to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Divide and the System.Linq.Expressions.BinaryExpression.Left
- // and System.Linq.Expressions.BinaryExpression.Right properties set to the
- // specified values.
+ // property equal to System.Linq.Expressions.ExpressionType.Coalesce 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 division operator is not defined for left.Type and right.Type.
+ // The System.Linq.Expressions.Expression.Type property of left does not represent
+ // a reference type or a nullable value type.
+ //
+ // System.ArgumentException:
+ // left.Type and right.Type are not convertible to each other.
[Pure]
- public static BinaryExpression Divide(Expression left, Expression right)
+ public static BinaryExpression Coalesce(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
@@ -1887,8 +2294,8 @@ public static BinaryExpression Divide(Expression left, Expression right)
}
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
- // division operation. The implementing method can be specified.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a coalescing
+ // operation, given a conversion function.
//
// Parameters:
// left:
@@ -1899,424 +2306,533 @@ public static BinaryExpression Divide(Expression left, Expression 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
+ // 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.Divide and the System.Linq.Expressions.BinaryExpression.Left,
- // System.Linq.Expressions.BinaryExpression.Right, and System.Linq.Expressions.BinaryExpression.Method
- // properties set to the specified values.
+ // property equal to System.Linq.Expressions.ExpressionType.Coalesce and the
+ // System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right
+ // and System.Linq.Expressions.BinaryExpression.Conversion 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.
+ // left.Type and right.Type are not convertible to each other. -or- conversion
+ // is not null and conversion.Type is a delegate type that does not take exactly
+ // one argument.
//
// System.InvalidOperationException:
- // method is null and the division operator is not defined for left.Type and
- // right.Type.
+ // The System.Linq.Expressions.Expression.Type property of left does not represent
+ // a reference type or a nullable value type. -or- The System.Linq.Expressions.Expression.Type
+ // property of left represents a type that is not assignable to the parameter
+ // type of the delegate type conversion.Type. -or- The System.Linq.Expressions.Expression.Type
+ // property of right is not equal to the return type of the delegate type conversion.Type.
[Pure]
- public static BinaryExpression Divide(Expression left, Expression right, MethodInfo method)
+ public static BinaryExpression Coalesce(Expression left, Expression right, LambdaExpression conversion)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result() != null);
return default(BinaryExpression);
}
+
//
// Summary:
- // Creates an System.Linq.Expressions.ElementInit, given an System.Collections.Generic.IEnumerable
- // as the second argument.
+ // Creates a System.Linq.Expressions.ConditionalExpression.
//
// Parameters:
- // addMethod:
- // A System.Reflection.MethodInfo to set the System.Linq.Expressions.ElementInit.AddMethod
+ // test:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.Test
// property equal to.
//
- // arguments:
- // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.Expression
- // objects to set the System.Linq.Expressions.ElementInit.Arguments property
- // equal to.
+ // ifTrue:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfTrue
+ // property equal to.
+ //
+ // ifFalse:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfFalse
+ // property equal to.
//
// Returns:
- // An System.Linq.Expressions.ElementInit that has the System.Linq.Expressions.ElementInit.AddMethod
- // and System.Linq.Expressions.ElementInit.Arguments properties set to the specified
- // values.
+ // A System.Linq.Expressions.ConditionalExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Conditional and
+ // the System.Linq.Expressions.ConditionalExpression.Test, System.Linq.Expressions.ConditionalExpression.IfTrue,
+ // and System.Linq.Expressions.ConditionalExpression.IfFalse properties set
+ // to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
- // addMethod or arguments is null.
+ // test or ifTrue or ifFalse is null.
//
// System.ArgumentException:
- // The method that addMethod represents is not named "Add" (case insensitive).
- // -or- The method that addMethod represents is not an instance method. -or-
- // arguments does not contain the same number of elements as the number of parameters
- // for the method that addMethod represents. -or- The System.Linq.Expressions.Expression.Type
- // property of one or more elements of arguments is not assignable to the type
- // of the corresponding parameter of the method that addMethod represents.
+ // test.Type is not System.Boolean. -or- ifTrue.Type is not equal to ifFalse.Type.
[Pure]
- public static ElementInit ElementInit(MethodInfo addMethod, IEnumerable arguments)
+ public static ConditionalExpression Condition(Expression test, Expression ifTrue, Expression ifFalse)
{
- Contract.Requires(addMethod != null);
- Contract.Requires(arguments != null);
- Contract.Ensures(Contract.Result() != null);
- return default(ElementInit);
+ Contract.Requires(test != null);
+ Contract.Requires(ifTrue != null);
+ Contract.Requires(ifFalse != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ConditionalExpression);
}
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates an System.Linq.Expressions.ElementInit, given an array of values
- // as the second argument.
+ // Creates a System.Linq.Expressions.ConditionalExpression that represents a conditional
+ // statement.
//
// Parameters:
- // addMethod:
- // A System.Reflection.MethodInfo to set the System.Linq.Expressions.ElementInit.AddMethod
+ // test:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.Test
// property equal to.
//
- // arguments:
- // An array of System.Linq.Expressions.Expression objects to set the System.Linq.Expressions.ElementInit.Arguments
+ // ifTrue:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfTrue
// property equal to.
//
- // Returns:
- // An System.Linq.Expressions.ElementInit that has the System.Linq.Expressions.ElementInit.AddMethod
- // and System.Linq.Expressions.ElementInit.Arguments properties set to the specified
- // values.
+ // ifFalse:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfFalse
+ // property equal to.
//
- // Exceptions:
- // System.ArgumentNullException:
- // addMethod or arguments is null.
+ // type:
+ // A System.Linq.Expressions.Expression.Type to set the System.Linq.Expressions.Expression.Type
+ // property equal to.
//
- // System.ArgumentException:
- // The method that addMethod represents is not named "Add" (case insensitive).
- // -or- The method that addMethod represents is not an instance method. -or-
- // arguments does not contain the same number of elements as the number of parameters
- // for the method that addMethod represents. -or- The System.Linq.Expressions.Expression.Type
- // property of one or more elements of arguments is not assignable to the type
- // of the corresponding parameter of the method that addMethod represents.
+ // Returns:
+ // A System.Linq.Expressions.ConditionalExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Conditional and the
+ // System.Linq.Expressions.ConditionalExpression.Test, System.Linq.Expressions.ConditionalExpression.IfTrue,
+ // and System.Linq.Expressions.ConditionalExpression.IfFalse properties set to the
+ // specified values.
[Pure]
- public static ElementInit ElementInit(MethodInfo addMethod, params Expression[] arguments)
+ public static ConditionalExpression Condition(Expression test, Expression ifTrue, Expression ifFalse, Type type)
{
- Contract.Requires(addMethod != null);
- Contract.Requires(arguments != null);
- Contract.Ensures(Contract.Result() != null);
- return default(ElementInit);
+ Contract.Requires(test != null);
+ Contract.Requires(ifTrue != null);
+ Contract.Requires(ifFalse != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ConditionalExpression);
}
+#endif
+
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents an equality
- // comparison.
+ // Creates a System.Linq.Expressions.ConstantExpression that has the System.Linq.Expressions.ConstantExpression.Value
+ // property set to the specified value.
//
// Parameters:
- // left:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
+ // value:
+ // An System.Object to set the System.Linq.Expressions.ConstantExpression.Value
// property equal to.
//
- // right:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
+ // Returns:
+ // A System.Linq.Expressions.ConstantExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Constant and the
+ // System.Linq.Expressions.ConstantExpression.Value property set to the specified
+ // value.
+ [Pure]
+ public static ConstantExpression Constant(object value)
+ {
+ Contract.Ensures(Contract.Result() != null);
+ return default(ConstantExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.ConstantExpression that has the System.Linq.Expressions.ConstantExpression.Value
+ // and System.Linq.Expressions.Expression.Type properties set to the specified
+ // values.
+ //
+ // Parameters:
+ // value:
+ // An System.Object to set the System.Linq.Expressions.ConstantExpression.Value
// property equal to.
//
+ // type:
+ // A System.Type to set the System.Linq.Expressions.Expression.Type property
+ // equal to.
+ //
// Returns:
- // A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Equal and the System.Linq.Expressions.BinaryExpression.Left
- // and System.Linq.Expressions.BinaryExpression.Right properties set to the
- // specified values.
+ // A System.Linq.Expressions.ConstantExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Constant and the
+ // System.Linq.Expressions.ConstantExpression.Value and System.Linq.Expressions.Expression.Type
+ // properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
- // left or right is null.
+ // type is null.
//
- // System.InvalidOperationException:
- // The equality operator is not defined for left.Type and right.Type.
+ // System.ArgumentException:
+ // value is not null and type is not assignable from the dynamic type of value.
[Pure]
- public static BinaryExpression Equal(Expression left, Expression right)
+ public static ConstantExpression Constant(object value, Type type)
{
- Contract.Requires(left != null);
- Contract.Requires(right != null);
- Contract.Ensures(Contract.Result() != null);
- return default(BinaryExpression);
+ Contract.Requires(type != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ConstantExpression);
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents an equality
- // comparison. The implementing method can be specified.
+ // Creates a System.Linq.Expressions.GotoExpression representing a continue statement.
//
// 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.
- //
- // liftToNull:
- // true to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to true;
- // false to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to false.
- //
- // method:
- // A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
- // property equal to.
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
//
// Returns:
- // A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Equal and the System.Linq.Expressions.BinaryExpression.Left,
- // System.Linq.Expressions.BinaryExpression.Right, System.Linq.Expressions.BinaryExpression.IsLiftedToNull,
- // and System.Linq.Expressions.BinaryExpression.Method properties set to the
- // specified values.
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Continue, the System.Linq.Expressions.GotoExpression.Target property
+ // set to target, and a null value to be passed to the target label upon jumping.
+ [Pure]
+ public static GotoExpression Continue(LabelTarget target)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
//
- // Exceptions:
- // System.ArgumentNullException:
- // left or right is null.
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a continue statement
+ // with the specified type.
//
- // 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.
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
//
- // System.InvalidOperationException:
- // method is null and the equality operator is not defined for left.Type and
- // right.Type.
+ // type:
+ // An System.Type to set the System.Linq.Expressions.Expression.Type property equal
+ // to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Continue, the System.Linq.Expressions.GotoExpression.Target property
+ // set to target, the System.Linq.Expressions.Expression.Type property set to type,
+ // and a null value to be passed to the target label upon jumping.
[Pure]
- public static BinaryExpression Equal(Expression left, Expression right, bool liftToNull, MethodInfo method)
+ public static GotoExpression Continue(LabelTarget target, Type type)
{
- Contract.Requires(left != null);
- Contract.Requires(right != null);
- Contract.Ensures(Contract.Result() != null);
- return default(BinaryExpression);
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
}
+#endif
+
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
- // XOR operation.
+ // Creates a System.Linq.Expressions.UnaryExpression that represents a conversion
+ // operation.
//
// Parameters:
- // left:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
+ // expression:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.UnaryExpression.Operand
// property equal to.
//
- // right:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
- // property equal to.
+ // type:
+ // A System.Type to set the System.Linq.Expressions.Expression.Type property
+ // equal to.
//
// Returns:
- // A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.ExclusiveOr and
- // the System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
+ // A System.Linq.Expressions.UnaryExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Convert and the
+ // System.Linq.Expressions.UnaryExpression.Operand and System.Linq.Expressions.Expression.Type
// properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
- // left or right is null.
+ // expression or type is null.
//
// System.InvalidOperationException:
- // The XOR operator is not defined for left.Type and right.Type.
+ // No conversion operator is defined between expression.Type and type.
[Pure]
- public static BinaryExpression ExclusiveOr(Expression left, Expression right)
+ public static UnaryExpression Convert(Expression expression, Type type)
{
- Contract.Requires(left != null);
- Contract.Requires(right != null);
- Contract.Ensures(Contract.Result() != null);
- return default(BinaryExpression);
+ Contract.Requires(expression != null);
+ Contract.Requires(type != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
- // XOR operation. The implementing method can be specified.
+ // Creates a System.Linq.Expressions.UnaryExpression that represents a conversion
+ // operation for which the implementing method is specified.
//
// Parameters:
- // left:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
+ // expression:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.UnaryExpression.Operand
// property equal to.
//
- // right:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
- // property equal to.
+ // type:
+ // A System.Type to set the System.Linq.Expressions.Expression.Type property
+ // equal to.
//
// method:
- // A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.UnaryExpression.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.ExclusiveOr and
- // the System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
- // and System.Linq.Expressions.BinaryExpression.Method properties set to the
+ // A System.Linq.Expressions.UnaryExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Convert and the
+ // System.Linq.Expressions.UnaryExpression.Operand, System.Linq.Expressions.Expression.Type,
+ // and System.Linq.Expressions.UnaryExpression.Method properties set to the
// specified values.
//
// Exceptions:
// System.ArgumentNullException:
- // left or right is null.
+ // expression or type 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.
+ // (Shared in Visual Basic), or does not take exactly one argument.
+ //
+ // System.Reflection.AmbiguousMatchException:
+ // More than one method that matches the method description was found.
//
// System.InvalidOperationException:
- // method is null and the XOR operator is not defined for left.Type and right.Type.
+ // No conversion operator is defined between expression.Type and type. -or-
+ // expression.Type is not assignable to the argument type of the method represented
+ // by method. -or- The return type of the method represented by method is not
+ // assignable to type. -or- expression.Type or type is a nullable value type
+ // and the corresponding non-nullable value type does not equal the argument
+ // type or the return type, respectively, of the method represented by method.
[Pure]
- public static BinaryExpression ExclusiveOr(Expression left, Expression right, MethodInfo method)
+ public static UnaryExpression Convert(Expression expression, Type type, MethodInfo method)
{
- Contract.Requires(left != null);
- Contract.Requires(right != null);
- Contract.Ensures(Contract.Result() != null);
- return default(BinaryExpression);
+ Contract.Requires(expression != null);
+ Contract.Requires(type != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.MemberExpression that represents accessing
- // a field.
+ // Creates a System.Linq.Expressions.UnaryExpression that represents a conversion
+ // operation that throws an exception if the target type is overflowed.
//
// Parameters:
// expression:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.MemberExpression.Expression
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.UnaryExpression.Operand
// property equal to.
//
- // field:
- // The System.Reflection.FieldInfo to set the System.Linq.Expressions.MemberExpression.Member
- // property equal to.
+ // type:
+ // A System.Type to set the System.Linq.Expressions.Expression.Type property
+ // equal to.
//
// Returns:
- // A System.Linq.Expressions.MemberExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.MemberAccess and
- // the System.Linq.Expressions.MemberExpression.Expression and System.Linq.Expressions.MemberExpression.Member
+ // A System.Linq.Expressions.UnaryExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.ConvertChecked and
+ // the System.Linq.Expressions.UnaryExpression.Operand and System.Linq.Expressions.Expression.Type
// properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
- // field is null. -or- The field represented by field is not static (Shared
- // in Visual Basic) and expression is null.
+ // expression or type is null.
//
- // System.ArgumentException:
- // expression.Type is not assignable to the declaring type of the field represented
- // by field.
+ // System.InvalidOperationException:
+ // No conversion operator is defined between expression.Type and type.
[Pure]
- public static MemberExpression Field(Expression expression, FieldInfo field)
+ public static UnaryExpression ConvertChecked(Expression expression, Type type)
{
- Contract.Requires(field != null);
- Contract.Ensures(Contract.Result() != null);
- return default(MemberExpression);
+ Contract.Requires(expression != null);
+ Contract.Requires(type != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.MemberExpression that represents accessing
- // a field given the name of the field.
+ // Creates a System.Linq.Expressions.UnaryExpression that represents a conversion
+ // operation that throws an exception if the target type is overflowed and for
+ // which the implementing method is specified.
//
// Parameters:
// expression:
- // An System.Linq.Expressions.Expression whose System.Linq.Expressions.Expression.Type
- // contains a field named fieldName.
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.UnaryExpression.Operand
+ // property equal to.
//
- // fieldName:
- // The name of a field.
+ // type:
+ // A System.Type to set the System.Linq.Expressions.Expression.Type property
+ // equal to.
+ //
+ // method:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.UnaryExpression.Method
+ // property equal to.
//
// Returns:
- // A System.Linq.Expressions.MemberExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.MemberAccess, the
- // System.Linq.Expressions.MemberExpression.Expression property set to expression,
- // and the System.Linq.Expressions.MemberExpression.Member property set to the
- // System.Reflection.FieldInfo that represents the field denoted by fieldName.
+ // A System.Linq.Expressions.UnaryExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.ConvertChecked and
+ // the System.Linq.Expressions.UnaryExpression.Operand, System.Linq.Expressions.Expression.Type,
+ // and System.Linq.Expressions.UnaryExpression.Method properties set to the
+ // specified values.
//
// Exceptions:
// System.ArgumentNullException:
- // expression or fieldName is null.
+ // expression or type is null.
//
// System.ArgumentException:
- // No field named fieldName is defined in expression.Type or its base types.
- [Pure]
- public static MemberExpression Field(Expression expression, string fieldName)
+ // method is not null and the method it represents returns void, is not static
+ // (Shared in Visual Basic), or does not take exactly one argument.
+ //
+ // System.Reflection.AmbiguousMatchException:
+ // More than one method that matches the method description was found.
+ //
+ // System.InvalidOperationException:
+ // No conversion operator is defined between expression.Type and type. -or-
+ // expression.Type is not assignable to the argument type of the method represented
+ // by method. -or- The return type of the method represented by method is not
+ // assignable to type. -or- expression.Type or type is a nullable value type
+ // and the corresponding non-nullable value type does not equal the argument
+ // type or the return type, respectively, of the method represented by method.
+ [Pure]
+ public static UnaryExpression ConvertChecked(Expression expression, Type type, MethodInfo method)
{
- Contract.Requires(fieldName != null);
Contract.Requires(expression != null);
-
- Contract.Ensures(Contract.Result() != null);
- return default(MemberExpression);
+ Contract.Requires(type != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates a System.Type object that represents a generic System.Action delegate
- // type that has specific type arguments.
+ // Creates a System.Linq.Expressions.DebugInfoExpression with the specified span.
//
// Parameters:
- // typeArgs:
- // An array of zero to four System.Type objects that specify the type arguments
- // for the System.Action delegate type.
+ // document:
+ // The System.Linq.Expressions.SymbolDocumentInfo that represents the source file.
+ //
+ // startLine:
+ // The start line of this System.Linq.Expressions.DebugInfoExpression. Must be greater
+ // than 0.
+ //
+ // startColumn:
+ // The start column of this System.Linq.Expressions.DebugInfoExpression. Must be
+ // greater than 0.
+ //
+ // endLine:
+ // The end line of this System.Linq.Expressions.DebugInfoExpression. Must be greater
+ // or equal than the start line.
+ //
+ // endColumn:
+ // The end column of this System.Linq.Expressions.DebugInfoExpression. If the end
+ // line is the same as the start line, it must be greater or equal than the start
+ // column. In any case, must be greater than 0.
//
// Returns:
- // The type of a System.Action delegate that has the specified type arguments.
+ // An instance of System.Linq.Expressions.DebugInfoExpression.
+ [Pure]
+ public static DebugInfoExpression DebugInfo(SymbolDocumentInfo document, int startLine, int startColumn, int endLine, int endColumn)
+ {
+ Contract.Requires(document != null);
+ Contract.Requires(startLine >= 1);
+ Contract.Requires(startColumn >= 1);
+ Contract.Requires(endLine >= startLine);
+ Contract.Requires(endColumn >= 1);
+ Contract.Requires(endLine != startLine || endColumn >= startColumn);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DebugInfoExpression);
+ }
+#endif
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
- // Exceptions:
- // System.ArgumentException:
- // typeArgs contains more than four elements.
+ // Summary:
+ // Creates a System.Linq.Expressions.UnaryExpression that represents the decrementing
+ // of the expression by 1.
//
- // System.ArgumentNullException:
- // typeArgs is null.
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to decrement.
+ //
+ // Returns:
+ // A System.Linq.Expressions.UnaryExpression that represents the decremented expression.
[Pure]
- public static Type GetActionType(params Type[] typeArgs)
+ public static UnaryExpression Decrement(Expression expression)
{
- Contract.Requires(typeArgs != null);
- Contract.Requires(typeArgs.Length <= 4);
- Contract.Ensures(Contract.Result() != null);
- return default(Type);
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
}
//
// Summary:
- // Creates a System.Type object that represents a generic System.Func delegate
- // type that has specific type arguments.
+ // Creates a System.Linq.Expressions.UnaryExpression that represents the decrementing
+ // of the expression by 1.
//
// Parameters:
- // typeArgs:
- // An array of one to five System.Type objects that specify the type arguments
- // for the System.Func delegate type.
+ // expression:
+ // An System.Linq.Expressions.Expression to decrement.
+ //
+ // method:
+ // A System.Reflection.MethodInfo that represents the implementing method.
//
// Returns:
- // The type of a System.Func delegate that has the specified type arguments.
+ // A System.Linq.Expressions.UnaryExpression that represents the decremented expression.
+ [Pure]
+ public static UnaryExpression Decrement(Expression expression, MethodInfo method)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
+ }
+#endif
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
- // Exceptions:
- // System.ArgumentException:
- // typeArgs contains less than one or more than five elements.
+ // Summary:
+ // Creates a System.Linq.Expressions.DefaultExpression that has the System.Linq.Expressions.Expression.Type
+ // property set to the specified type.
//
- // System.ArgumentNullException:
- // typeArgs is null.
+ // Parameters:
+ // type:
+ // A System.Type to set the System.Linq.Expressions.Expression.Type property equal
+ // to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.DefaultExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Default and the System.Linq.Expressions.Expression.Type
+ // property set to the specified type.
[Pure]
- public static Type GetFuncType(params Type[] typeArgs)
+ public static DefaultExpression Default(Type type)
{
- Contract.Requires(typeArgs != null);
- Contract.Requires(typeArgs.Length >= 1);
- Contract.Requires(typeArgs.Length <= 5);
- Contract.Ensures(Contract.Result() != null);
- return default(Type);
+ Contract.Requires(type != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DefaultExpression);
}
+#endif
+
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a "greater
- // than" numeric comparison.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
+ // division operation.
//
// Parameters:
// left:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
- // property equal to.
+ // property to.
//
// right:
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
- // property equal to.
+ // property to.
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.GreaterThan and
- // the System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
- // properties set to the specified values.
+ // property equal to System.Linq.Expressions.ExpressionType.Divide 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 "greater than" operator is not defined for left.Type and right.Type.
+ // The division operator is not defined for left.Type and right.Type.
[Pure]
- public static BinaryExpression GreaterThan(Expression left, Expression right)
+ public static BinaryExpression Divide(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
@@ -2325,8 +2841,8 @@ public static BinaryExpression GreaterThan(Expression left, Expression right)
}
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a "greater
- // than" numeric comparison. The implementing method can be specified.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents an arithmetic
+ // division operation. The implementing method can be specified.
//
// Parameters:
// left:
@@ -2337,19 +2853,14 @@ public static BinaryExpression GreaterThan(Expression left, Expression right)
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
- // liftToNull:
- // true to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to true;
- // false to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to false.
- //
// 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.GreaterThan and
- // the System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
- // System.Linq.Expressions.BinaryExpression.IsLiftedToNull, and System.Linq.Expressions.BinaryExpression.Method
+ // property equal to System.Linq.Expressions.ExpressionType.Divide 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:
@@ -2361,20 +2872,22 @@ public static BinaryExpression GreaterThan(Expression left, Expression right)
// (Shared in Visual Basic), or does not take exactly two arguments.
//
// System.InvalidOperationException:
- // method is null and the "greater than" operator is not defined for left.Type
- // and right.Type.
+ // method is null and the division operator is not defined for left.Type and
+ // right.Type.
[Pure]
- public static BinaryExpression GreaterThan(Expression left, Expression right, bool liftToNull, MethodInfo method)
+ public static BinaryExpression Divide(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result() != null);
return default(BinaryExpression);
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a "greater
- // than or equal" numeric comparison.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a division
+ // assignment operation that does not have overflow checking.
//
// Parameters:
// left:
@@ -2387,18 +2900,11 @@ public static BinaryExpression GreaterThan(Expression left, Expression right, bo
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.GreaterThanOrEqual
- // and the System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
+ // property equal to System.Linq.Expressions.ExpressionType.DivideAssign 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 "greater than or equal" operator is not defined for left.Type and right.Type.
[Pure]
- public static BinaryExpression GreaterThanOrEqual(Expression left, Expression right)
+ public static BinaryExpression DivideAssign(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
@@ -2407,8 +2913,8 @@ public static BinaryExpression GreaterThanOrEqual(Expression left, Expression ri
}
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a "greater
- // than or equal" numeric comparison. The implementing method can be specified.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a division
+ // assignment operation that does not have overflow checking.
//
// Parameters:
// left:
@@ -2419,34 +2925,18 @@ public static BinaryExpression GreaterThanOrEqual(Expression left, Expression ri
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
- // liftToNull:
- // true to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to true;
- // false to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to false.
- //
// 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.GreaterThanOrEqual
- // and the System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
- // System.Linq.Expressions.BinaryExpression.IsLiftedToNull, 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 "greater than or equal" operator is not defined for
- // left.Type and right.Type.
+ // property equal to System.Linq.Expressions.ExpressionType.DivideAssign 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 GreaterThanOrEqual(Expression left, Expression right, bool liftToNull, MethodInfo method)
+ public static BinaryExpression DivideAssign(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
@@ -2455,294 +2945,341 @@ public static BinaryExpression GreaterThanOrEqual(Expression left, Expression ri
}
//
// Summary:
- // Creates an System.Linq.Expressions.InvocationExpression.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a division
+ // assignment operation that does not have overflow checking.
//
// Parameters:
- // expression:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.InvocationExpression.Expression
+ // left:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
// property equal to.
//
- // arguments:
- // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.Expression
- // objects to use to populate the System.Linq.Expressions.InvocationExpression.Arguments
- // collection.
- //
- // Returns:
- // An System.Linq.Expressions.InvocationExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Invoke and the System.Linq.Expressions.InvocationExpression.Expression
- // and System.Linq.Expressions.InvocationExpression.Arguments properties set
- // to the specified values.
+ // right:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
+ // property equal to.
//
- // Exceptions:
- // System.ArgumentNullException:
- // expression is null.
+ // method:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
+ // property equal to.
//
- // System.ArgumentException:
- // expression.Type does not represent a delegate type or an System.Linq.Expressions.Expression.
- // -or- The System.Linq.Expressions.Expression.Type property of an element
- // of arguments is not assignable to the type of the corresponding parameter
- // of the delegate represented by expression.
+ // conversion:
+ // A System.Linq.Expressions.LambdaExpression to set the System.Linq.Expressions.BinaryExpression.Conversion
+ // property equal to.
//
- // System.InvalidOperationException:
- // arguments does not contain the same number of elements as the list of parameters
- // for the delegate represented by expression.
+ // Returns:
+ // A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.DivideAssign 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 InvocationExpression Invoke(Expression expression, IEnumerable arguments)
+ public static BinaryExpression DivideAssign(Expression left, Expression right, MethodInfo method, LambdaExpression conversion)
{
- Contract.Requires(expression != null);
- Contract.Ensures(Contract.Result() != null);
- return default(InvocationExpression);
+ Contract.Requires(left != null);
+ Contract.Requires(right != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(BinaryExpression);
}
+#endif
+
+#if NETFRAMEWORK_4_0
//
// Summary:
- // Creates an System.Linq.Expressions.InvocationExpression.
+ // Creates a System.Linq.Expressions.DynamicExpression that represents a dynamic
+ // operation bound by the provided System.Runtime.CompilerServices.CallSiteBinder.
//
// Parameters:
- // expression:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.InvocationExpression.Expression
- // property equal to.
+ // binder:
+ // The runtime binder for the dynamic operation.
+ //
+ // returnType:
+ // The result type of the dynamic expression.
//
// arguments:
- // An array of System.Linq.Expressions.Expression objects to use to populate
- // the System.Linq.Expressions.InvocationExpression.Arguments collection.
+ // The arguments to the dynamic operation.
//
// Returns:
- // An System.Linq.Expressions.InvocationExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Invoke and the System.Linq.Expressions.InvocationExpression.Expression
- // and System.Linq.Expressions.InvocationExpression.Arguments properties set
- // to the specified values.
- //
- // Exceptions:
- // System.ArgumentNullException:
- // expression is null.
- //
- // System.ArgumentException:
- // expression.Type does not represent a delegate type or an System.Linq.Expressions.Expression.
- // -or- The System.Linq.Expressions.Expression.Type property of an element
- // of arguments is not assignable to the type of the corresponding parameter
- // of the delegate represented by expression.
- //
- // System.InvalidOperationException:
- // arguments does not contain the same number of elements as the list of parameters
- // for the delegate represented by expression.
+ // A System.Linq.Expressions.DynamicExpression that has System.Linq.Expressions.Expression.NodeType
+ // equal to System.Linq.Expressions.ExpressionType.Dynamic and has the System.Linq.Expressions.DynamicExpression.Binder
+ // and System.Linq.Expressions.DynamicExpression.Arguments set to the specified
+ // values.
[Pure]
- public static InvocationExpression Invoke(Expression expression, params Expression[] arguments)
+ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable arguments)
{
- Contract.Requires(expression != null);
- Contract.Ensures(Contract.Result() != null);
- return default(InvocationExpression);
+ Contract.Requires(binder != null);
+ Contract.Requires(returnType != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DynamicExpression);
}
//
// Summary:
- // Creates an System.Linq.Expressions.Expression where the delegate
- // type is known at compile time.
+ // Creates a System.Linq.Expressions.DynamicExpression that represents a dynamic
+ // operation bound by the provided System.Runtime.CompilerServices.CallSiteBinder.
//
// Parameters:
- // body:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
- // property equal to.
+ // binder:
+ // The runtime binder for the dynamic operation.
//
- // parameters:
- // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.ParameterExpression
- // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
- // collection.
+ // returnType:
+ // The result type of the dynamic expression.
//
- // Type parameters:
- // TDelegate:
- // A delegate type.
+ // arg0:
+ // The first argument to the dynamic operation.
//
// Returns:
- // An System.Linq.Expressions.Expression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
- // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
- // the specified values.
+ // A System.Linq.Expressions.DynamicExpression that has System.Linq.Expressions.Expression.NodeType
+ // equal to System.Linq.Expressions.ExpressionType.Dynamic and has the System.Linq.Expressions.DynamicExpression.Binder
+ // and System.Linq.Expressions.DynamicExpression.Arguments set to the specified
+ // values.
+ [Pure]
+ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0)
+ {
+ Contract.Requires(binder != null);
+ Contract.Requires(returnType != null);
+ Contract.Requires(arg0 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DynamicExpression);
+ }
//
- // Exceptions:
- // System.ArgumentNullException:
- // body is null. -or- One or more elements in parameters are null.
+ // Summary:
+ // Creates a System.Linq.Expressions.DynamicExpression that represents a dynamic
+ // operation bound by the provided System.Runtime.CompilerServices.CallSiteBinder.
//
- // System.ArgumentException:
- // TDelegate is not a delegate type. -or- body.Type represents a type that
- // is not assignable to the return type of TDelegate. -or- parameters does
- // not contain the same number of elements as the list of parameters for TDelegate.
- // -or- The System.Linq.Expressions.Expression.Type property of an element
- // of parameters is not assignable from the type of the corresponding parameter
- // type of TDelegate.
+ // Parameters:
+ // binder:
+ // The runtime binder for the dynamic operation.
+ //
+ // returnType:
+ // The result type of the dynamic expression.
+ //
+ // arguments:
+ // The arguments to the dynamic operation.
+ //
+ // Returns:
+ // A System.Linq.Expressions.DynamicExpression that has System.Linq.Expressions.Expression.NodeType
+ // equal to System.Linq.Expressions.ExpressionType.Dynamic and has the System.Linq.Expressions.DynamicExpression.Binder
+ // and System.Linq.Expressions.DynamicExpression.Arguments set to the specified
+ // values.
[Pure]
- public static Expression Lambda(Expression body, IEnumerable parameters)
+ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params Expression[] arguments)
{
- Contract.Requires(body != null);
- Contract.Ensures(Contract.Result>() != null);
- return default(Expression);
+ Contract.Requires(binder != null);
+ Contract.Requires(returnType != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DynamicExpression);
}
//
// Summary:
- // Creates an System.Linq.Expressions.Expression where the delegate
- // type is known at compile time.
+ // Creates a System.Linq.Expressions.DynamicExpression that represents a dynamic
+ // operation bound by the provided System.Runtime.CompilerServices.CallSiteBinder.
//
// Parameters:
- // body:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
- // property equal to.
+ // binder:
+ // The runtime binder for the dynamic operation.
//
- // parameters:
- // An array of System.Linq.Expressions.ParameterExpression objects to use to
- // populate the System.Linq.Expressions.LambdaExpression.Parameters collection.
+ // returnType:
+ // The result type of the dynamic expression.
//
- // Type parameters:
- // TDelegate:
- // A delegate type.
+ // arg0:
+ // The first argument to the dynamic operation.
+ //
+ // arg1:
+ // The second argument to the dynamic operation.
//
// Returns:
- // An System.Linq.Expressions.Expression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
- // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
- // the specified values.
+ // A System.Linq.Expressions.DynamicExpression that has System.Linq.Expressions.Expression.NodeType
+ // equal to System.Linq.Expressions.ExpressionType.Dynamic and has the System.Linq.Expressions.DynamicExpression.Binder
+ // and System.Linq.Expressions.DynamicExpression.Arguments set to the specified
+ // values.
+ [Pure]
+ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1)
+ {
+ Contract.Requires(binder != null);
+ Contract.Requires(returnType != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DynamicExpression);
+ }
//
- // Exceptions:
- // System.ArgumentNullException:
- // body is null. -or- One or more elements in parameters are null.
+ // Summary:
+ // Creates a System.Linq.Expressions.DynamicExpression that represents a dynamic
+ // operation bound by the provided System.Runtime.CompilerServices.CallSiteBinder.
//
- // System.ArgumentException:
- // TDelegate is not a delegate type. -or- body.Type represents a type that
- // is not assignable to the return type of TDelegate. -or- parameters does
- // not contain the same number of elements as the list of parameters for TDelegate.
- // -or- The System.Linq.Expressions.Expression.Type property of an element
- // of parameters is not assignable from the type of the corresponding parameter
- // type of TDelegate.
+ // Parameters:
+ // binder:
+ // The runtime binder for the dynamic operation.
+ //
+ // returnType:
+ // The result type of the dynamic expression.
+ //
+ // arg0:
+ // The first argument to the dynamic operation.
+ //
+ // arg1:
+ // The second argument to the dynamic operation.
+ //
+ // arg2:
+ // The third argument to the dynamic operation.
+ //
+ // Returns:
+ // A System.Linq.Expressions.DynamicExpression that has System.Linq.Expressions.Expression.NodeType
+ // equal to System.Linq.Expressions.ExpressionType.Dynamic and has the System.Linq.Expressions.DynamicExpression.Binder
+ // and System.Linq.Expressions.DynamicExpression.Arguments set to the specified
+ // values.
[Pure]
- public static Expression Lambda(Expression body, params ParameterExpression[] parameters)
+ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2)
{
- Contract.Requires(body != null);
- Contract.Ensures(Contract.Result>() != null);
- return default(Expression);
+ Contract.Requires(binder != null);
+ Contract.Requires(returnType != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DynamicExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.LambdaExpression by first constructing
- // a delegate type.
+ // Creates a System.Linq.Expressions.DynamicExpression that represents a dynamic
+ // operation bound by the provided System.Runtime.CompilerServices.CallSiteBinder.
//
// Parameters:
- // body:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
- // property equal to.
+ // binder:
+ // The runtime binder for the dynamic operation.
//
- // parameters:
- // An array of System.Linq.Expressions.ParameterExpression objects to use to
- // populate the System.Linq.Expressions.LambdaExpression.Parameters collection.
+ // returnType:
+ // The result type of the dynamic expression.
//
- // Returns:
- // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
- // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
- // the specified values.
+ // arg0:
+ // The first argument to the dynamic operation.
//
- // Exceptions:
- // System.ArgumentNullException:
- // body is null. -or- One or more elements of parameters are null.
+ // arg1:
+ // The second argument to the dynamic operation.
//
- // System.ArgumentException:
- // parameters contains more than four elements.
+ // arg2:
+ // The third argument to the dynamic operation.
+ //
+ // arg3:
+ // The fourth argument to the dynamic operation.
+ //
+ // Returns:
+ // A System.Linq.Expressions.DynamicExpression that has System.Linq.Expressions.Expression.NodeType
+ // equal to System.Linq.Expressions.ExpressionType.Dynamic and has the System.Linq.Expressions.DynamicExpression.Binder
+ // and System.Linq.Expressions.DynamicExpression.Arguments set to the specified
+ // values.
[Pure]
- public static LambdaExpression Lambda(Expression body, params ParameterExpression[] parameters)
+ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
{
- Contract.Requires(body != null);
- Contract.Ensures(Contract.Result() != null);
- return default(LambdaExpression);
+ Contract.Requires(binder != null);
+ Contract.Requires(returnType != null);
+ Contract.Requires(arg0 != null);
+ Contract.Requires(arg1 != null);
+ Contract.Requires(arg2 != null);
+ Contract.Requires(arg3 != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(DynamicExpression);
}
+#endif
+
//
// Summary:
- // Creates a System.Linq.Expressions.LambdaExpression and can be used when the
- // delegate type is not known at compile time.
+ // Creates an System.Linq.Expressions.ElementInit, given an System.Collections.Generic.IEnumerable
+ // as the second argument.
//
// Parameters:
- // delegateType:
- // A System.Type that represents a delegate type.
- //
- // body:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // addMethod:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.ElementInit.AddMethod
// property equal to.
//
- // parameters:
- // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.ParameterExpression
- // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
- // collection.
+ // arguments:
+ // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.Expression
+ // objects to set the System.Linq.Expressions.ElementInit.Arguments property
+ // equal to.
//
// Returns:
- // An object that represents a lambda expression which has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
- // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
- // the specified values.
+ // An System.Linq.Expressions.ElementInit that has the System.Linq.Expressions.ElementInit.AddMethod
+ // and System.Linq.Expressions.ElementInit.Arguments properties set to the specified
+ // values.
//
// Exceptions:
// System.ArgumentNullException:
- // delegateType or body is null. -or- One or more elements in parameters are
- // null.
+ // addMethod or arguments is null.
//
// System.ArgumentException:
- // delegateType does not represent a delegate type. -or- body.Type represents
- // a type that is not assignable to the return type of the delegate type represented
- // by delegateType. -or- parameters does not contain the same number of elements
- // as the list of parameters for the delegate type represented by delegateType.
- // -or- The System.Linq.Expressions.Expression.Type property of an element
- // of parameters is not assignable from the type of the corresponding parameter
- // type of the delegate type represented by delegateType.
+ // The method that addMethod represents is not named "Add" (case insensitive).
+ // -or- The method that addMethod represents is not an instance method. -or-
+ // arguments does not contain the same number of elements as the number of parameters
+ // for the method that addMethod represents. -or- The System.Linq.Expressions.Expression.Type
+ // property of one or more elements of arguments is not assignable to the type
+ // of the corresponding parameter of the method that addMethod represents.
[Pure]
- public static LambdaExpression Lambda(Type delegateType, Expression body, IEnumerable parameters)
+ public static ElementInit ElementInit(MethodInfo addMethod, IEnumerable arguments)
{
- Contract.Requires(delegateType != null);
- Contract.Requires(body != null);
- Contract.Ensures(Contract.Result() != null);
- return default(LambdaExpression);
+ Contract.Requires(addMethod != null);
+ Contract.Requires(arguments != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ElementInit);
}
//
// Summary:
- // Creates a System.Linq.Expressions.LambdaExpression and can be used when the
- // delegate type is not known at compile time.
+ // Creates an System.Linq.Expressions.ElementInit, given an array of values
+ // as the second argument.
//
// Parameters:
- // delegateType:
- // A System.Type that represents a delegate type.
- //
- // body:
- // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // addMethod:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.ElementInit.AddMethod
// property equal to.
//
- // parameters:
- // An array of System.Linq.Expressions.ParameterExpression objects to use to
- // populate the System.Linq.Expressions.LambdaExpression.Parameters collection.
+ // arguments:
+ // An array of System.Linq.Expressions.Expression objects to set the System.Linq.Expressions.ElementInit.Arguments
+ // property equal to.
//
// Returns:
- // An object that represents a lambda expression which has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
- // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
- // the specified values.
+ // An System.Linq.Expressions.ElementInit that has the System.Linq.Expressions.ElementInit.AddMethod
+ // and System.Linq.Expressions.ElementInit.Arguments properties set to the specified
+ // values.
//
// Exceptions:
// System.ArgumentNullException:
- // delegateType or body is null. -or- One or more elements in parameters are
- // null.
+ // addMethod or arguments is null.
//
// System.ArgumentException:
- // delegateType does not represent a delegate type. -or- body.Type represents
- // a type that is not assignable to the return type of the delegate type represented
- // by delegateType. -or- parameters does not contain the same number of elements
- // as the list of parameters for the delegate type represented by delegateType.
- // -or- The System.Linq.Expressions.Expression.Type property of an element
- // of parameters is not assignable from the type of the corresponding parameter
- // type of the delegate type represented by delegateType.
+ // The method that addMethod represents is not named "Add" (case insensitive).
+ // -or- The method that addMethod represents is not an instance method. -or-
+ // arguments does not contain the same number of elements as the number of parameters
+ // for the method that addMethod represents. -or- The System.Linq.Expressions.Expression.Type
+ // property of one or more elements of arguments is not assignable to the type
+ // of the corresponding parameter of the method that addMethod represents.
[Pure]
- public static LambdaExpression Lambda(Type delegateType, Expression body, params ParameterExpression[] parameters)
+ public static ElementInit ElementInit(MethodInfo addMethod, params Expression[] arguments)
{
- Contract.Requires(delegateType != null);
- Contract.Requires(body != null);
- Contract.Ensures(Contract.Result() != null);
- return default(LambdaExpression);
+ Contract.Requires(addMethod != null);
+ Contract.Requires(arguments != null);
+ Contract.Requires(arguments.Length >= 1);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ElementInit);
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
- // left-shift operation.
+ // Creates an empty expression that has System.Void type.
+ //
+ // Returns:
+ // A System.Linq.Expressions.DefaultExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Default and the System.Linq.Expressions.Expression.Type
+ // property set to System.Void.
+ [Pure]
+ public static DefaultExpression Empty()
+ {
+ Contract.Ensures(Contract.Result() != null);
+ return default(DefaultExpression);
+ }
+#endif
+
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.BinaryExpression that represents an equality
+ // comparison.
//
// Parameters:
// left:
@@ -2755,18 +3292,18 @@ public static LambdaExpression Lambda(Type delegateType, Expression body, params
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.LeftShift and the
- // System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
- // properties set to the specified values.
+ // property equal to System.Linq.Expressions.ExpressionType.Equal 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 left-shift operator is not defined for left.Type and right.Type.
+ // The equality operator is not defined for left.Type and right.Type.
[Pure]
- public static BinaryExpression LeftShift(Expression left, Expression right)
+ public static BinaryExpression Equal(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
@@ -2775,8 +3312,8 @@ public static BinaryExpression LeftShift(Expression left, Expression right)
}
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
- // left-shift operation. The implementing method can be specified.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents an equality
+ // comparison. The implementing method can be specified.
//
// Parameters:
// left:
@@ -2787,14 +3324,18 @@ public static BinaryExpression LeftShift(Expression left, Expression 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
+ // liftToNull:
+ // true to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to true;
+ // false to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to false.
+ //
+ // 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.LeftShift and the
- // System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
+ // property equal to System.Linq.Expressions.ExpressionType.Equal and the System.Linq.Expressions.BinaryExpression.Left,
+ // System.Linq.Expressions.BinaryExpression.Right, System.Linq.Expressions.BinaryExpression.IsLiftedToNull,
// and System.Linq.Expressions.BinaryExpression.Method properties set to the
// specified values.
//
@@ -2807,20 +3348,21 @@ public static BinaryExpression LeftShift(Expression left, Expression right)
// (Shared in Visual Basic), or does not take exactly two arguments.
//
// System.InvalidOperationException:
- // method is null and the left-shift operator is not defined for left.Type and
+ // method is null and the equality operator is not defined for left.Type and
// right.Type.
[Pure]
- public static BinaryExpression LeftShift(Expression left, Expression right, MethodInfo method)
+ public static BinaryExpression Equal(Expression left, Expression right, bool liftToNull, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result() != null);
return default(BinaryExpression);
}
+
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a "less
- // than" numeric comparison.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
+ // XOR operation.
//
// Parameters:
// left:
@@ -2833,8 +3375,8 @@ public static BinaryExpression LeftShift(Expression left, Expression right, Meth
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.LessThan and the
- // System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
+ // property equal to System.Linq.Expressions.ExpressionType.ExclusiveOr and
+ // the System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
// properties set to the specified values.
//
// Exceptions:
@@ -2842,9 +3384,9 @@ public static BinaryExpression LeftShift(Expression left, Expression right, Meth
// left or right is null.
//
// System.InvalidOperationException:
- // The "less than" operator is not defined for left.Type and right.Type.
+ // The XOR operator is not defined for left.Type and right.Type.
[Pure]
- public static BinaryExpression LessThan(Expression left, Expression right)
+ public static BinaryExpression ExclusiveOr(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
@@ -2853,8 +3395,8 @@ public static BinaryExpression LessThan(Expression left, Expression right)
}
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a "less
- // than" numeric comparison. The implementing method can be specified.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
+ // XOR operation. The implementing method can be specified.
//
// Parameters:
// left:
@@ -2865,20 +3407,16 @@ public static BinaryExpression LessThan(Expression left, Expression right)
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
- // liftToNull:
- // true to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to true;
- // false to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to false.
- //
// 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.LessThan and the
- // System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
- // System.Linq.Expressions.BinaryExpression.IsLiftedToNull, and System.Linq.Expressions.BinaryExpression.Method
- // properties set to the specified values.
+ // property equal to System.Linq.Expressions.ExpressionType.ExclusiveOr 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:
@@ -2889,20 +3427,21 @@ public static BinaryExpression LessThan(Expression left, Expression right)
// (Shared in Visual Basic), or does not take exactly two arguments.
//
// System.InvalidOperationException:
- // method is null and the "less than" operator is not defined for left.Type
- // and right.Type.
+ // method is null and the XOR operator is not defined for left.Type and right.Type.
[Pure]
- public static BinaryExpression LessThan(Expression left, Expression right, bool liftToNull, MethodInfo method)
+ public static BinaryExpression ExclusiveOr(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
Contract.Ensures(Contract.Result() != null);
return default(BinaryExpression);
}
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a " less
- // than or equal" numeric comparison.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
+ // XOR assignment operation, using op_ExclusiveOr for user-defined types.
//
// Parameters:
// left:
@@ -2915,18 +3454,11 @@ public static BinaryExpression LessThan(Expression left, Expression right, bool
//
// Returns:
// A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
- // property equal to System.Linq.Expressions.ExpressionType.LessThanOrEqual
- // and the System.Linq.Expressions.BinaryExpression.Left and System.Linq.Expressions.BinaryExpression.Right
+ // property equal to System.Linq.Expressions.ExpressionType.ExclusiveOrAssign 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 "less than or equal" operator is not defined for left.Type and right.Type.
[Pure]
- public static BinaryExpression LessThanOrEqual(Expression left, Expression right)
+ public static BinaryExpression ExclusiveOrAssign(Expression left, Expression right)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
@@ -2935,8 +3467,8 @@ public static BinaryExpression LessThanOrEqual(Expression left, Expression right
}
//
// Summary:
- // Creates a System.Linq.Expressions.BinaryExpression that represents a " less
- // than or equal" numeric comparison. The implementing method can be specified.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
+ // XOR assignment operation, using op_ExclusiveOr for user-defined types.
//
// Parameters:
// left:
@@ -2947,34 +3479,18 @@ public static BinaryExpression LessThanOrEqual(Expression left, Expression right
// An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
// property equal to.
//
- // liftToNull:
- // true to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to true;
- // false to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to false.
- //
// 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.LessThanOrEqual
- // and the System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
- // System.Linq.Expressions.BinaryExpression.IsLiftedToNull, 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 "less than or equal" operator is not defined for left.Type
- // and right.Type.
+ // property equal to System.Linq.Expressions.ExpressionType.ExclusiveOrAssign 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 LessThanOrEqual(Expression left, Expression right, bool liftToNull, MethodInfo method)
+ public static BinaryExpression ExclusiveOrAssign(Expression left, Expression right, MethodInfo method)
{
Contract.Requires(left != null);
Contract.Requires(right != null);
@@ -2983,475 +3499,4572 @@ public static BinaryExpression LessThanOrEqual(Expression left, Expression right
}
//
// Summary:
- // Creates a System.Linq.Expressions.MemberListBinding where the member is a
- // field or property.
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a bitwise
+ // XOR assignment operation, using op_ExclusiveOr for user-defined types.
//
// Parameters:
- // member:
- // A System.Reflection.MemberInfo that represents a field or property to set
- // the System.Linq.Expressions.MemberBinding.Member property equal to.
+ // left:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Left
+ // property equal to.
//
- // initializers:
- // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.ElementInit
- // objects to use to populate the System.Linq.Expressions.MemberListBinding.Initializers
- // collection.
+ // right:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.BinaryExpression.Right
+ // property equal to.
//
- // Returns:
- // A System.Linq.Expressions.MemberListBinding that has the System.Linq.Expressions.MemberBinding.BindingType
- // property equal to System.Linq.Expressions.MemberBindingType.ListBinding and
- // the System.Linq.Expressions.MemberBinding.Member and System.Linq.Expressions.MemberListBinding.Initializers
- // properties set to the specified values.
+ // method:
+ // A System.Reflection.MethodInfo to set the System.Linq.Expressions.BinaryExpression.Method
+ // property equal to.
//
- // Exceptions:
- // System.ArgumentNullException:
- // member is null. -or- One or more elements of initializers is null.
+ // conversion:
+ // A System.Linq.Expressions.LambdaExpression to set the System.Linq.Expressions.BinaryExpression.Conversion
+ // property equal to.
//
- // System.ArgumentException:
- // member does not represent a field or property. -or- The System.Reflection.FieldInfo.FieldType
- // or System.Reflection.PropertyInfo.PropertyType of the field or property that
- // member represents does not implement System.Collections.IEnumerable.
+ // Returns:
+ // A System.Linq.Expressions.BinaryExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.ExclusiveOrAssign 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 MemberListBinding ListBind(MemberInfo member, IEnumerable initializers)
+ public static BinaryExpression ExclusiveOrAssign(Expression left, Expression right, MethodInfo method, LambdaExpression conversion)
{
- Contract.Requires(member != null);
- Contract.Ensures(Contract.Result() != null);
- return default(MemberListBinding);
+ Contract.Requires(left != null);
+ Contract.Requires(right != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(BinaryExpression);
}
+#endif
+
//
// Summary:
- // Creates a System.Linq.Expressions.MemberListBinding where the member is a
- // field or property.
+ // Creates a System.Linq.Expressions.MemberExpression that represents accessing
+ // a field.
//
// Parameters:
- // member:
- // A System.Reflection.MemberInfo that represents a field or property to set
- // the System.Linq.Expressions.MemberBinding.Member property equal to.
+ // expression:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.MemberExpression.Expression
+ // property equal to.
//
- // initializers:
- // An array of System.Linq.Expressions.ElementInit objects to use to populate
- // the System.Linq.Expressions.MemberListBinding.Initializers collection.
+ // field:
+ // The System.Reflection.FieldInfo to set the System.Linq.Expressions.MemberExpression.Member
+ // property equal to.
//
// Returns:
- // A System.Linq.Expressions.MemberListBinding that has the System.Linq.Expressions.MemberBinding.BindingType
- // property equal to System.Linq.Expressions.MemberBindingType.ListBinding and
- // the System.Linq.Expressions.MemberBinding.Member and System.Linq.Expressions.MemberListBinding.Initializers
+ // A System.Linq.Expressions.MemberExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.MemberAccess and
+ // the System.Linq.Expressions.MemberExpression.Expression and System.Linq.Expressions.MemberExpression.Member
// properties set to the specified values.
//
// Exceptions:
// System.ArgumentNullException:
- // member is null. -or- One or more elements of initializers is null.
+ // field is null. -or- The field represented by field is not static (Shared
+ // in Visual Basic) and expression is null.
//
// System.ArgumentException:
- // member does not represent a field or property. -or- The System.Reflection.FieldInfo.FieldType
- // or System.Reflection.PropertyInfo.PropertyType of the field or property that
- // member represents does not implement System.Collections.IEnumerable.
+ // expression.Type is not assignable to the declaring type of the field represented
+ // by field.
[Pure]
- public static MemberListBinding ListBind(MemberInfo member, params ElementInit[] initializers)
+ public static MemberExpression Field(Expression expression, FieldInfo field)
{
- Contract.Requires(member != null);
- Contract.Ensures(Contract.Result() != null);
- return default(MemberListBinding);
+ Contract.Requires(field != null);
+ Contract.Requires(field.IsStatic || expression != null);
+ Contract.Requires(!field.IsStatic || expression == null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MemberExpression);
}
//
// Summary:
- // Creates a System.Linq.Expressions.MemberListBinding based on a specified
- // property accessor method.
+ // Creates a System.Linq.Expressions.MemberExpression that represents accessing
+ // a field given the name of the field.
//
// Parameters:
- // propertyAccessor:
- // A System.Reflection.MethodInfo that represents a property accessor method.
+ // expression:
+ // An System.Linq.Expressions.Expression whose System.Linq.Expressions.Expression.Type
+ // contains a field named fieldName.
//
- // initializers:
- // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.ElementInit
- // objects to use to populate the System.Linq.Expressions.MemberListBinding.Initializers
- // collection.
+ // fieldName:
+ // The name of a field.
//
// Returns:
- // A System.Linq.Expressions.MemberListBinding that has the System.Linq.Expressions.MemberBinding.BindingType
- // property equal to System.Linq.Expressions.MemberBindingType.ListBinding,
- // the System.Linq.Expressions.MemberBinding.Member property set to the System.Reflection.MemberInfo
- // that represents the property accessed in propertyAccessor, and System.Linq.Expressions.MemberListBinding.Initializers
- // populated with the elements of initializers.
+ // A System.Linq.Expressions.MemberExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.MemberAccess, the
+ // System.Linq.Expressions.MemberExpression.Expression property set to expression,
+ // and the System.Linq.Expressions.MemberExpression.Member property set to the
+ // System.Reflection.FieldInfo that represents the field denoted by fieldName.
//
// Exceptions:
// System.ArgumentNullException:
- // propertyAccessor is null. -or- One or more elements of initializers are null.
+ // expression or fieldName is null.
//
// System.ArgumentException:
- // propertyAccessor does not represent a property accessor method. -or- The
- // System.Reflection.PropertyInfo.PropertyType of the property that the method
- // represented by propertyAccessor accesses does not implement System.Collections.IEnumerable.
+ // No field named fieldName is defined in expression.Type or its base types.
[Pure]
- public static MemberListBinding ListBind(MethodInfo propertyAccessor, IEnumerable initializers)
+ public static MemberExpression Field(Expression expression, string fieldName)
{
- Contract.Requires(propertyAccessor != null);
- Contract.Ensures(Contract.Result() != null);
- return default(MemberListBinding);
+ Contract.Requires(fieldName != null);
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MemberExpression);
}
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
//
// Summary:
- // Creates a System.Linq.Expressions.MemberListBinding object based on a specified
- // property accessor method.
+ // Creates a System.Linq.Expressions.MemberExpression that represents accessing
+ // a field.
//
// Parameters:
- // propertyAccessor:
- // A System.Reflection.MethodInfo that represents a property accessor method.
- //
- // initializers:
- // An array of System.Linq.Expressions.ElementInit objects to use to populate
- // the System.Linq.Expressions.MemberListBinding.Initializers collection.
+ // expression:
+ // The containing object of the field. This can be null for static fields.
//
- // Returns:
- // A System.Linq.Expressions.MemberListBinding that has the System.Linq.Expressions.MemberBinding.BindingType
- // property equal to System.Linq.Expressions.MemberBindingType.ListBinding,
- // the System.Linq.Expressions.MemberBinding.Member property set to the System.Reflection.MemberInfo
- // that represents the property accessed in propertyAccessor, and System.Linq.Expressions.MemberListBinding.Initializers
- // populated with the elements of initializers.
+ // type:
+ // The System.Linq.Expressions.Expression.Type that contains the field.
//
- // Exceptions:
- // System.ArgumentNullException:
- // propertyAccessor is null. -or- One or more elements of initializers is null.
+ // fieldName:
+ // The field to be accessed.
//
- // System.ArgumentException:
- // propertyAccessor does not represent a property accessor method. -or- The
- // System.Reflection.PropertyInfo.PropertyType of the property that the method
- // represented by propertyAccessor accesses does not implement System.Collections.IEnumerable.
+ // Returns:
+ // The created System.Linq.Expressions.MemberExpression.
[Pure]
- public static MemberListBinding ListBind(MethodInfo propertyAccessor, params ElementInit[] initializers)
+ public static MemberExpression Field(Expression expression, Type type, string fieldName)
{
- Contract.Requires(propertyAccessor != null);
- Contract.Ensures(Contract.Result() != null);
- return default(MemberListBinding);
+ Contract.Requires(type != null);
+ Contract.Requires(fieldName != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(MemberExpression);
}
+#endif
+
//
// Summary:
- // Creates a System.Linq.Expressions.ListInitExpression that uses specified
+ // Creates a System.Type object that represents a generic System.Action delegate
+ // type that has specific type arguments.
+ //
+ // Parameters:
+ // typeArgs:
+ // An array of zero to four System.Type objects that specify the type arguments
+ // for the System.Action delegate type.
+ //
+ // Returns:
+ // The type of a System.Action delegate that has the specified type arguments.
+ //
+ // Exceptions:
+ // System.ArgumentException:
+ // typeArgs contains more than four elements.
+ //
+ // System.ArgumentNullException:
+ // typeArgs is null.
+ [Pure]
+ public static Type GetActionType(params Type[] typeArgs)
+ {
+ Contract.Requires(typeArgs != null);
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ Contract.Requires(typeArgs.Length <= 16);
+#else
+ Contract.Requires(typeArgs.Length <= 4);
+#endif
+ Contract.Ensures(Contract.Result() != null);
+ return default(Type);
+ }
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Gets a System.Linq.Expressions.Expression.Type object that represents a generic
+ // System.Func or System.Action delegate type that has specific type arguments.
+ //
+ // Parameters:
+ // typeArgs:
+ // The type arguments of the delegate.
+ //
+ // Returns:
+ // The delegate type.
+ [Pure]
+ public static Type GetDelegateType(params Type[] typeArgs)
+ {
+ Contract.Requires(typeArgs != null);
+ Contract.Requires(typeArgs.Length >= 1);
+ Contract.Ensures(Contract.Result() != null);
+ return default(Type);
+ }
+#endif
+
+ //
+ // Summary:
+ // Creates a System.Type object that represents a generic System.Func delegate
+ // type that has specific type arguments.
+ //
+ // Parameters:
+ // typeArgs:
+ // An array of one to five System.Type objects that specify the type arguments
+ // for the System.Func delegate type.
+ //
+ // Returns:
+ // The type of a System.Func delegate that has the specified type arguments.
+ //
+ // Exceptions:
+ // System.ArgumentException:
+ // typeArgs contains less than one or more than five elements.
+ //
+ // System.ArgumentNullException:
+ // typeArgs is null.
+ [Pure]
+ public static Type GetFuncType(params Type[] typeArgs)
+ {
+ Contract.Requires(typeArgs != null);
+ Contract.Requires(typeArgs.Length >= 1);
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ Contract.Requires(typeArgs.Length <= 17);
+#else
+ Contract.Requires(typeArgs.Length <= 5);
+#endif
+ Contract.Ensures(Contract.Result() != null);
+ return default(Type);
+ }
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a "go to" statement.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Goto, the System.Linq.Expressions.GotoExpression.Target property set
+ // to the specified value, and a null value to be passed to the target label upon
+ // jumping.
+ [Pure]
+ public static GotoExpression Goto(LabelTarget target)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a "go to" statement.
+ // The value passed to the label upon jumping can be specified.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
+ //
+ // value:
+ // The value that will be passed to the associated label upon jumping.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Goto, the System.Linq.Expressions.GotoExpression.Target property set
+ // to target, and value to be passed to the target label upon jumping.
+ [Pure]
+ public static GotoExpression Goto(LabelTarget target, Expression value)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a "go to" statement
+ // with the specified type.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
+ //
+ // type:
+ // An System.Type to set the System.Linq.Expressions.Expression.Type property equal
+ // to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Goto, the System.Linq.Expressions.GotoExpression.Target property set
+ // to the specified value, the System.Linq.Expressions.Expression.Type property
+ // set to type, and a null value to be passed to the target label upon jumping.
+ [Pure]
+ public static GotoExpression Goto(LabelTarget target, Type type)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.GotoExpression representing a "go to" statement
+ // with the specified type. The value passed to the label upon jumping can be specified.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget that the System.Linq.Expressions.GotoExpression
+ // will jump to.
+ //
+ // value:
+ // The value that will be passed to the associated label upon jumping.
+ //
+ // type:
+ // An System.Type to set the System.Linq.Expressions.Expression.Type property equal
+ // to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.GotoExpression with System.Linq.Expressions.GotoExpression.Kind
+ // equal to Goto, the System.Linq.Expressions.GotoExpression.Target property set
+ // to target, the System.Linq.Expressions.Expression.Type property set to type,
+ // and value to be passed to the target label upon jumping.
+ [Pure]
+ public static GotoExpression Goto(LabelTarget target, Expression value, Type type)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(GotoExpression);
+ }
+#endif
+
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a "greater
+ // than" numeric comparison.
+ //
+ // 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.GreaterThan 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 "greater than" operator is not defined for left.Type and right.Type.
+ [Pure]
+ public static BinaryExpression GreaterThan(Expression left, Expression right)
+ {
+ Contract.Requires(left != null);
+ Contract.Requires(right != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(BinaryExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a "greater
+ // than" numeric comparison. 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.
+ //
+ // liftToNull:
+ // true to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to true;
+ // false to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to false.
+ //
+ // 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.GreaterThan and
+ // the System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
+ // System.Linq.Expressions.BinaryExpression.IsLiftedToNull, 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 "greater than" operator is not defined for left.Type
+ // and right.Type.
+ [Pure]
+ public static BinaryExpression GreaterThan(Expression left, Expression right, bool liftToNull, MethodInfo method)
+ {
+ Contract.Requires(left != null);
+ Contract.Requires(right != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(BinaryExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a "greater
+ // than or equal" numeric comparison.
+ //
+ // 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.GreaterThanOrEqual
+ // 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 "greater than or equal" operator is not defined for left.Type and right.Type.
+ [Pure]
+ public static BinaryExpression GreaterThanOrEqual(Expression left, Expression right)
+ {
+ Contract.Requires(left != null);
+ Contract.Requires(right != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(BinaryExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.BinaryExpression that represents a "greater
+ // than or equal" numeric comparison. 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.
+ //
+ // liftToNull:
+ // true to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to true;
+ // false to set System.Linq.Expressions.BinaryExpression.IsLiftedToNull to false.
+ //
+ // 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.GreaterThanOrEqual
+ // and the System.Linq.Expressions.BinaryExpression.Left, System.Linq.Expressions.BinaryExpression.Right,
+ // System.Linq.Expressions.BinaryExpression.IsLiftedToNull, 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 "greater than or equal" operator is not defined for
+ // left.Type and right.Type.
+ [Pure]
+ public static BinaryExpression GreaterThanOrEqual(Expression left, Expression right, bool liftToNull, MethodInfo method)
+ {
+ Contract.Requires(left != null);
+ Contract.Requires(right != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(BinaryExpression);
+ }
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.ConditionalExpression that represents a conditional
+ // block with an if statement.
+ //
+ // Parameters:
+ // test:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.Test
+ // property equal to.
+ //
+ // ifTrue:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfTrue
+ // property equal to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.ConditionalExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Conditional and the
+ // System.Linq.Expressions.ConditionalExpression.Test, System.Linq.Expressions.ConditionalExpression.IfTrue,
+ // properties set to the specified values. The System.Linq.Expressions.ConditionalExpression.IfFalse
+ // property is set to default expression and the type of the resulting System.Linq.Expressions.ConditionalExpression
+ // returned by this method is System.Void.
+ [Pure]
+ public static ConditionalExpression IfThen(Expression test, Expression ifTrue)
+ {
+ Contract.Requires(test != null);
+ Contract.Requires(ifTrue != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ConditionalExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.ConditionalExpression that represents a conditional
+ // block with if and else statements.
+ //
+ // Parameters:
+ // test:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.Test
+ // property equal to.
+ //
+ // ifTrue:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfTrue
+ // property equal to.
+ //
+ // ifFalse:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.ConditionalExpression.IfFalse
+ // property equal to.
+ //
+ // Returns:
+ // A System.Linq.Expressions.ConditionalExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Conditional and the
+ // System.Linq.Expressions.ConditionalExpression.Test, System.Linq.Expressions.ConditionalExpression.IfTrue,
+ // and System.Linq.Expressions.ConditionalExpression.IfFalse properties set to the
+ // specified values. The type of the resulting System.Linq.Expressions.ConditionalExpression
+ // returned by this method is System.Void.
+ [Pure]
+ public static ConditionalExpression IfThenElse(Expression test, Expression ifTrue, Expression ifFalse)
+ {
+ Contract.Requires(test != null);
+ Contract.Requires(ifTrue != null);
+ Contract.Requires(ifFalse != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(ConditionalExpression);
+ }
+#endif
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.UnaryExpression that represents the incrementing
+ // of the expression value by 1.
+ //
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to increment.
+ //
+ // Returns:
+ // A System.Linq.Expressions.UnaryExpression that represents the incremented expression.
+ [Pure]
+ public static UnaryExpression Increment(Expression expression)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.UnaryExpression that represents the incrementing
+ // of the expression by 1.
+ //
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to increment.
+ //
+ // method:
+ // A System.Reflection.MethodInfo that represents the implementing method.
+ //
+ // Returns:
+ // A System.Linq.Expressions.UnaryExpression that represents the incremented expression.
+ [Pure]
+ public static UnaryExpression Increment(Expression expression, MethodInfo method)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
+ }
+#endif
+
+ //
+ // Summary:
+ // Creates an System.Linq.Expressions.InvocationExpression.
+ //
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.InvocationExpression.Expression
+ // property equal to.
+ //
+ // arguments:
+ // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.Expression
+ // objects to use to populate the System.Linq.Expressions.InvocationExpression.Arguments
+ // collection.
+ //
+ // Returns:
+ // An System.Linq.Expressions.InvocationExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Invoke and the System.Linq.Expressions.InvocationExpression.Expression
+ // and System.Linq.Expressions.InvocationExpression.Arguments properties set
+ // to the specified values.
+ //
+ // Exceptions:
+ // System.ArgumentNullException:
+ // expression is null.
+ //
+ // System.ArgumentException:
+ // expression.Type does not represent a delegate type or an System.Linq.Expressions.Expression.
+ // -or- The System.Linq.Expressions.Expression.Type property of an element
+ // of arguments is not assignable to the type of the corresponding parameter
+ // of the delegate represented by expression.
+ //
+ // System.InvalidOperationException:
+ // arguments does not contain the same number of elements as the list of parameters
+ // for the delegate represented by expression.
+ [Pure]
+ public static InvocationExpression Invoke(Expression expression, IEnumerable arguments)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(InvocationExpression);
+ }
+ //
+ // Summary:
+ // Creates an System.Linq.Expressions.InvocationExpression.
+ //
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.InvocationExpression.Expression
+ // property equal to.
+ //
+ // arguments:
+ // An array of System.Linq.Expressions.Expression objects to use to populate
+ // the System.Linq.Expressions.InvocationExpression.Arguments collection.
+ //
+ // Returns:
+ // An System.Linq.Expressions.InvocationExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Invoke and the System.Linq.Expressions.InvocationExpression.Expression
+ // and System.Linq.Expressions.InvocationExpression.Arguments properties set
+ // to the specified values.
+ //
+ // Exceptions:
+ // System.ArgumentNullException:
+ // expression is null.
+ //
+ // System.ArgumentException:
+ // expression.Type does not represent a delegate type or an System.Linq.Expressions.Expression.
+ // -or- The System.Linq.Expressions.Expression.Type property of an element
+ // of arguments is not assignable to the type of the corresponding parameter
+ // of the delegate represented by expression.
+ //
+ // System.InvalidOperationException:
+ // arguments does not contain the same number of elements as the list of parameters
+ // for the delegate represented by expression.
+ [Pure]
+ public static InvocationExpression Invoke(Expression expression, params Expression[] arguments)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(InvocationExpression);
+ }
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Returns whether the expression evaluates to false.
+ //
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to evaluate.
+ //
+ // Returns:
+ // An instance of System.Linq.Expressions.UnaryExpression.
+ [Pure]
+ public static UnaryExpression IsFalse(Expression expression)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
+ }
+ //
+ // Summary:
+ // Returns whether the expression evaluates to false.
+ //
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to evaluate.
+ //
+ // method:
+ // A System.Reflection.MethodInfo that represents the implementing method.
+ //
+ // Returns:
+ // An instance of System.Linq.Expressions.UnaryExpression.
+ [Pure]
+ public static UnaryExpression IsFalse(Expression expression, MethodInfo method)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
+ }
+#endif
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Returns whether the expression evaluates to true.
+ //
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to evaluate.
+ //
+ // Returns:
+ // An instance of System.Linq.Expressions.UnaryExpression.
+ [Pure]
+ public static UnaryExpression IsTrue(Expression expression)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
+ }
+ //
+ // Summary:
+ // Returns whether the expression evaluates to true.
+ //
+ // Parameters:
+ // expression:
+ // An System.Linq.Expressions.Expression to evaluate.
+ //
+ // method:
+ // A System.Reflection.MethodInfo that represents the implementing method.
+ //
+ // Returns:
+ // An instance of System.Linq.Expressions.UnaryExpression.
+ [Pure]
+ public static UnaryExpression IsTrue(Expression expression, MethodInfo method)
+ {
+ Contract.Requires(expression != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(UnaryExpression);
+ }
+#endif
+
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LabelTarget representing a label with void
+ // type and no name.
+ //
+ // Returns:
+ // The new System.Linq.Expressions.LabelTarget.
+ [Pure]
+ public static LabelTarget Label()
+ {
+ Contract.Ensures(Contract.Result() != null);
+ Contract.Ensures(Contract.Result().Type == typeof(void));
+ return default(LabelTarget);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LabelTarget representing a label with the given
+ // type.
+ //
+ // Parameters:
+ // type:
+ // The type of value that is passed when jumping to the label.
+ //
+ // Returns:
+ // The new System.Linq.Expressions.LabelTarget.
+ [Pure]
+ public static LabelTarget Label(Type type)
+ {
+ Contract.Ensures(Contract.Result() != null);
+ Contract.Ensures(Contract.Result().Type == type);
+ return default(LabelTarget);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LabelTarget representing a label with void
+ // type and the given name.
+ //
+ // Parameters:
+ // name:
+ // The name of the label.
+ //
+ // Returns:
+ // The new System.Linq.Expressions.LabelTarget.
+ [Pure]
+ public static LabelTarget Label(string name)
+ {
+ Contract.Ensures(Contract.Result() != null);
+ Contract.Ensures(Contract.Result().Type == typeof(void));
+ return default(LabelTarget);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LabelExpression representing a label without
+ // a default value.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget which this System.Linq.Expressions.LabelExpression
+ // will be associated with.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LabelExpression without a default value.
+ [Pure]
+ public static LabelExpression Label(LabelTarget target)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ Contract.Ensures(Contract.Result().Target == target);
+ return default(LabelExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LabelTarget representing a label with the given
+ // type and name.
+ //
+ // Parameters:
+ // type:
+ // The type of value that is passed when jumping to the label.
+ //
+ // name:
+ // The name of the label.
+ //
+ // Returns:
+ // The new System.Linq.Expressions.LabelTarget.
+ [Pure]
+ public static LabelTarget Label(Type type, string name)
+ {
+ Contract.Ensures(Contract.Result() != null);
+ return default(LabelTarget);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LabelExpression representing a label with the
+ // given default value.
+ //
+ // Parameters:
+ // target:
+ // The System.Linq.Expressions.LabelTarget which this System.Linq.Expressions.LabelExpression
+ // will be associated with.
+ //
+ // defaultValue:
+ // The value of this System.Linq.Expressions.LabelExpression when the label is reached
+ // through regular control flow.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LabelExpression with the given default value.
+ [Pure]
+ public static LabelExpression Label(LabelTarget target, Expression defaultValue)
+ {
+ Contract.Requires(target != null);
+ Contract.Ensures(Contract.Result() != null);
+ Contract.Ensures(Contract.Result().Target == target);
+ return default(LabelExpression);
+ }
+#endif
+
+ //
+ // Summary:
+ // Creates an System.Linq.Expressions.Expression where the delegate
+ // type is known at compile time.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Type parameters:
+ // TDelegate:
+ // A delegate type.
+ //
+ // Returns:
+ // An System.Linq.Expressions.Expression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
+ // the specified values.
+ //
+ // Exceptions:
+ // System.ArgumentNullException:
+ // body is null. -or- One or more elements in parameters are null.
+ //
+ // System.ArgumentException:
+ // TDelegate is not a delegate type. -or- body.Type represents a type that
+ // is not assignable to the return type of TDelegate. -or- parameters does
+ // not contain the same number of elements as the list of parameters for TDelegate.
+ // -or- The System.Linq.Expressions.Expression.Type property of an element
+ // of parameters is not assignable from the type of the corresponding parameter
+ // type of TDelegate.
+ [Pure]
+ public static Expression Lambda(Expression body, IEnumerable parameters)
+ {
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result>() != null);
+ return default(Expression);
+ }
+ //
+ // Summary:
+ // Creates an System.Linq.Expressions.Expression where the delegate
+ // type is known at compile time.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // parameters:
+ // An array of System.Linq.Expressions.ParameterExpression objects to use to
+ // populate the System.Linq.Expressions.LambdaExpression.Parameters collection.
+ //
+ // Type parameters:
+ // TDelegate:
+ // A delegate type.
+ //
+ // Returns:
+ // An System.Linq.Expressions.Expression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
+ // the specified values.
+ //
+ // Exceptions:
+ // System.ArgumentNullException:
+ // body is null. -or- One or more elements in parameters are null.
+ //
+ // System.ArgumentException:
+ // TDelegate is not a delegate type. -or- body.Type represents a type that
+ // is not assignable to the return type of TDelegate. -or- parameters does
+ // not contain the same number of elements as the list of parameters for TDelegate.
+ // -or- The System.Linq.Expressions.Expression.Type property of an element
+ // of parameters is not assignable from the type of the corresponding parameter
+ // type of TDelegate.
+ [Pure]
+ public static Expression Lambda(Expression body, params ParameterExpression[] parameters)
+ {
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result>() != null);
+ return default(Expression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LambdaExpression by first constructing
+ // a delegate type.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // parameters:
+ // An array of System.Linq.Expressions.ParameterExpression objects to use to
+ // populate the System.Linq.Expressions.LambdaExpression.Parameters collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
+ // the specified values.
+ //
+ // Exceptions:
+ // System.ArgumentNullException:
+ // body is null. -or- One or more elements of parameters are null.
+ //
+ // System.ArgumentException:
+ // parameters contains more than four elements.
+ [Pure]
+ public static LambdaExpression Lambda(Expression body, params ParameterExpression[] parameters)
+ {
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LambdaExpression and can be used when the
+ // delegate type is not known at compile time.
+ //
+ // Parameters:
+ // delegateType:
+ // A System.Type that represents a delegate type.
+ //
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Returns:
+ // An object that represents a lambda expression which has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
+ // the specified values.
+ //
+ // Exceptions:
+ // System.ArgumentNullException:
+ // delegateType or body is null. -or- One or more elements in parameters are
+ // null.
+ //
+ // System.ArgumentException:
+ // delegateType does not represent a delegate type. -or- body.Type represents
+ // a type that is not assignable to the return type of the delegate type represented
+ // by delegateType. -or- parameters does not contain the same number of elements
+ // as the list of parameters for the delegate type represented by delegateType.
+ // -or- The System.Linq.Expressions.Expression.Type property of an element
+ // of parameters is not assignable from the type of the corresponding parameter
+ // type of the delegate type represented by delegateType.
+ [Pure]
+ public static LambdaExpression Lambda(Type delegateType, Expression body, IEnumerable parameters)
+ {
+ Contract.Requires(delegateType != null);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a System.Linq.Expressions.LambdaExpression and can be used when the
+ // delegate type is not known at compile time.
+ //
+ // Parameters:
+ // delegateType:
+ // A System.Type that represents a delegate type.
+ //
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // parameters:
+ // An array of System.Linq.Expressions.ParameterExpression objects to use to
+ // populate the System.Linq.Expressions.LambdaExpression.Parameters collection.
+ //
+ // Returns:
+ // An object that represents a lambda expression which has the System.Linq.Expressions.Expression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to
+ // the specified values.
+ //
+ // Exceptions:
+ // System.ArgumentNullException:
+ // delegateType or body is null. -or- One or more elements in parameters are
+ // null.
+ //
+ // System.ArgumentException:
+ // delegateType does not represent a delegate type. -or- body.Type represents
+ // a type that is not assignable to the return type of the delegate type represented
+ // by delegateType. -or- parameters does not contain the same number of elements
+ // as the list of parameters for the delegate type represented by delegateType.
+ // -or- The System.Linq.Expressions.Expression.Type property of an element
+ // of parameters is not assignable from the type of the corresponding parameter
+ // type of the delegate type represented by delegateType.
+ [Pure]
+ public static LambdaExpression Lambda(Type delegateType, Expression body, params ParameterExpression[] parameters)
+ {
+ Contract.Requires(delegateType != null);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+#if NETFRAMEWORK_4_0 || SILVERLIGHT_4_0 || SILVERLIGHT_5_0
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable`1 that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Expression body, IEnumerable parameters)
+ {
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // tailCall:
+ // A System.Boolean that indicates if tail call optimization will be applied when
+ // compiling the created expression.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable`1 that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Expression body, bool tailCall, IEnumerable parameters)
+ {
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // name:
+ // The name for the lambda. Used for emitting debug information.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable`1 that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Expression body, string name, IEnumerable parameters)
+ {
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // tailCall:
+ // A System.Boolean that indicates if tail call optimization will be applied when
+ // compiling the created expression.
+ //
+ // parameters:
+ // An array that contains System.Linq.Expressions.ParameterExpression objects to
+ // use to populate the System.Linq.Expressions.LambdaExpression.Parameters collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Expression body, bool tailCall, params ParameterExpression[] parameters)
+ {
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // delegateType:
+ // A System.Linq.Expressions.Expression.Type representing the delegate signature
+ // for the lambda.
+ //
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // tailCall:
+ // A System.Boolean that indicates if tail call optimization will be applied when
+ // compiling the created expression.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable`1 that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Type delegateType, Expression body, bool tailCall, IEnumerable parameters)
+ {
+ Contract.Requires(delegateType != null);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // name:
+ // The name for the lambda. Used for emitting debug information.
+ //
+ // tailCall:
+ // A System.Boolean that indicates if tail call optimization will be applied when
+ // compiling the created expression.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable`1 that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Expression body, string name, bool tailCall, IEnumerable parameters)
+ {
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // delegateType:
+ // A System.Linq.Expressions.Expression.Type representing the delegate signature
+ // for the lambda.
+ //
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // name:
+ // The name for the lambda. Used for emitting debug information.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable`1 that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Type delegateType, Expression body, string name, IEnumerable parameters)
+ {
+ Contract.Requires(delegateType != null);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // delegateType:
+ // A System.Linq.Expressions.Expression.Type representing the delegate signature
+ // for the lambda.
+ //
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // tailCall:
+ // A System.Boolean that indicates if tail call optimization will be applied when
+ // compiling the created expression.
+ //
+ // parameters:
+ // An array that contains System.Linq.Expressions.ParameterExpression objects to
+ // use to populate the System.Linq.Expressions.LambdaExpression.Parameters collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Type delegateType, Expression body, bool tailCall, params ParameterExpression[] parameters)
+ {
+ Contract.Requires(delegateType != null);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates a LambdaExpression by first constructing a delegate type.
+ //
+ // Parameters:
+ // delegateType:
+ // A System.Linq.Expressions.Expression.Type representing the delegate signature
+ // for the lambda.
+ //
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // name:
+ // The name for the lambda. Used for emitting debug information.
+ //
+ // tailCall:
+ // A System.Boolean that indicates if tail call optimization will be applied when
+ // compiling the created expression.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable`1 that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Returns:
+ // A System.Linq.Expressions.LambdaExpression that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to Lambda and the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static LambdaExpression Lambda(Type delegateType, Expression body, string name, bool tailCall, IEnumerable parameters)
+ {
+ Contract.Requires(delegateType != null);
+ Contract.Requires(body != null);
+ Contract.Ensures(Contract.Result() != null);
+ return default(LambdaExpression);
+ }
+ //
+ // Summary:
+ // Creates an System.Linq.Expressions.Expression`1 where the delegate type is known
+ // at compile time.
+ //
+ // Parameters:
+ // body:
+ // An System.Linq.Expressions.Expression to set the System.Linq.Expressions.LambdaExpression.Body
+ // property equal to.
+ //
+ // tailCall:
+ // A System.Boolean that indicates if tail call optimization will be applied when
+ // compiling the created expression.
+ //
+ // parameters:
+ // An System.Collections.Generic.IEnumerable`1 that contains System.Linq.Expressions.ParameterExpression
+ // objects to use to populate the System.Linq.Expressions.LambdaExpression.Parameters
+ // collection.
+ //
+ // Type parameters:
+ // TDelegate:
+ // The delegate type.
+ //
+ // Returns:
+ // An System.Linq.Expressions.Expression`1 that has the System.Linq.Expressions.LambdaExpression.NodeType
+ // property equal to System.Linq.Expressions.ExpressionType.Lambdaand the System.Linq.Expressions.LambdaExpression.Body
+ // and System.Linq.Expressions.LambdaExpression.Parameters properties set to the
+ // specified values.
+ [Pure]
+ public static Expression Lambda(Expression body, bool tailCall, IEnumerable