CodeBinaryOperatorExpression クラス
アセンブリ: System (system.dll 内)

<SerializableAttribute> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ <ComVisibleAttribute(True)> _ Public Class CodeBinaryOperatorExpression Inherits CodeExpression
[SerializableAttribute] [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] [ComVisibleAttribute(true)] public class CodeBinaryOperatorExpression : CodeExpression
[SerializableAttribute] [ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] [ComVisibleAttribute(true)] public ref class CodeBinaryOperatorExpression : public CodeExpression

CodeBinaryOperatorExpression を使用して、二項演算子を含んだコード式を表すことができます。二項演算子には、等値演算子 (==)、加算演算子 (+)、ビット処理演算子 (|) などがあります。CodeBinaryOperatorType 列挙体は、多くの言語がサポートする、基本的で一般に使用される二項演算子を表します。

CodeBinaryOperatorExpression を使用して 2 つの数値を加算する例を次に示します。
' This CodeBinaryOperatorExpression represents the addition of 1 and 2. Dim addMethod As New CodeBinaryOperatorExpression( _ New CodePrimitiveExpression(1), _ CodeBinaryOperatorType.Add, _ New CodePrimitiveExpression(2) ) ' A Visual Basic code generator produces the following source code for the preceeding example code: ' (1 + 2)
// 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)
// This CodeBinaryOperatorExpression represents the addition of 1 and 2. // Right operand. CodeBinaryOperatorExpression^ addMethod = gcnew CodeBinaryOperatorExpression( gcnew CodePrimitiveExpression( 1 ),CodeBinaryOperatorType::Add,gcnew CodePrimitiveExpression( 2 ) ); // A C# code generator produces the following source code for the preceeding example code: // (1 + 2)
// This CodeBinaryOperatorExpression represents the addition of 1 and 2. CodeBinaryOperatorExpression addMethod = new CodeBinaryOperatorExpression( // Left operand. new CodePrimitiveExpression(System.Convert.ToString(1)), // CodeBinaryOperatorType enumeration value of Add. CodeBinaryOperatorType.Add, // Right operand. new CodePrimitiveExpression(System.Convert.ToString(2))); // A VJ# code generator produces the following source code // for the preceeding example code: // (1 + 2)

System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeBinaryOperatorExpression


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- CodeBinaryOperatorExpression クラスのページへのリンク