CodeBinaryOperatorExpression クラス

定義

2 つの式の間の二項演算から構成される式を表します。

public ref class CodeBinaryOperatorExpression : System::CodeDom::CodeExpression
public class CodeBinaryOperatorExpression : System.CodeDom.CodeExpression
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeBinaryOperatorExpression : System.CodeDom.CodeExpression
type CodeBinaryOperatorExpression = class
    inherit CodeExpression
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeBinaryOperatorExpression = class
    inherit CodeExpression
Public Class CodeBinaryOperatorExpression
Inherits CodeExpression
継承
CodeBinaryOperatorExpression
属性

この例では、 を CodeBinaryOperatorExpression 使用して 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(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.
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)

注釈

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

コンストラクター

CodeBinaryOperatorExpression()

CodeBinaryOperatorExpression クラスの新しいインスタンスを初期化します。

CodeBinaryOperatorExpression(CodeExpression, CodeBinaryOperatorType, CodeExpression)

指定されたパラメーターを使用して、CodeBinaryOperatorExpression クラスの新しいインスタンスを初期化します。

プロパティ

Left

演算子の左辺にあるコード式を取得または設定します。

Operator

二項演算式の演算子を取得または設定します。

Right

演算子の右辺にあるコード式を取得または設定します。

UserData

現在のオブジェクトのユーザー定義可能なデータを取得します。

(継承元 CodeObject)

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください