Exemple #1
0
 /// <summary>
 /// Creates an addition expression.
 /// </summary>
 /// <param name="left">The left operand.</param>
 /// <param name="right">The right operand.</param>
 /// <returns>An addition expression.</returns>
 public static CodeBinaryOperatorExpression Add(this CodeExpression left, CodeParameterDeclarationExpression right)
 {
     return new CodeBinaryOperatorExpression(left, CodeBinaryOperatorType.Add, right.Reference());
 }
Exemple #2
0
 /// <summary>
 /// Creates a less-than-or-equal expression.
 /// </summary>
 /// <param name="left">The left operand.</param>
 /// <param name="right">The right operand.</param>
 /// <returns>A less-than-or-equal expression.</returns>
 public static CodeBinaryOperatorExpression LessThanOrEqual(this CodeExpression left, CodeParameterDeclarationExpression right)
 {
     return new CodeBinaryOperatorExpression(left, CodeBinaryOperatorType.LessThanOrEqual, right.Reference());
 }
Exemple #3
0
 /// <summary>
 /// Creates a delegate-create expression.
 /// </summary>
 /// <param name="type">The type of the delegate.</param>
 /// <param name="parameter">The object on which the delegate is created.</param>
 /// <param name="method">The method that gets invoked when the delegate is invoked.</param>
 /// <returns>A delegate-create expression.</returns>
 public static CodeDelegateCreateExpression CreateDelegate(this CodeTypeReference type, CodeParameterDeclarationExpression parameter, CodeMemberMethod method)
 {
     return type.CreateDelegate(parameter.Reference(), method.Name);
 }
Exemple #4
0
 /// <summary>
 /// Creates an identity-inequality expression.
 /// </summary>
 /// <param name="left">The left operand.</param>
 /// <param name="right">The right operand.</param>
 /// <returns>A identity-inequality expression.</returns>
 public static CodeBinaryOperatorExpression IdentityInequality(this CodeExpression left, CodeParameterDeclarationExpression right)
 {
     return new CodeBinaryOperatorExpression(left, CodeBinaryOperatorType.IdentityInequality, right.Reference());
 }
Exemple #5
0
 /// <summary>
 /// Creates an assignment statement.
 /// </summary>
 /// <param name="left">The left operand.</param>
 /// <param name="right">The right operand.</param>
 /// <returns>An assignment statement.</returns>
 public static CodeAssignStatement Assign(this CodeExpression left, CodeParameterDeclarationExpression right)
 {
     return left.Assign(right.Reference());
 }