CodeBinaryOperatorExpression クラス

定義

2 つの式間のバイナリ演算で構成される式を表します。

public ref 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
[<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.
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)

適用対象

こちらもご覧ください