Represents an expression that consists of a binary operation between two expressions.
Assembly: System (in System.dll)
can be used to represent code expressions that include a binary operator. Some examples of binary operators are equality (==), addition (+), and bitwise (|) operators. The CodeBinaryOperatorType enumeration represents a set of basic, commonly used binary operators that are supported in many languages.
This example demonstrates use of a to add two numbers together.
// This CodeBinaryOperatorExpression represents the addition of 1 and 2. CodeBinaryOperatorExpression addMethod = new CodeBinaryOperatorExpression( // Left operand. new CodePrimitiveExpression(1), // CodeBinaryOperatorType enumeration value of Add. CodeBinaryOperatorType.Add, // Right operand. new CodePrimitiveExpression(2) ); // A C# code generator produces the following source code for the preceeding example code: // (1 + 2)
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.