CodeBinaryOperatorExpression Sınıf

Tanım

İki ifade arasındaki ikili işlemden oluşan bir ifadeyi temsil eder.

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
Devralma
CodeBinaryOperatorExpression
Öznitelikler

Örnekler

Bu örnekte, birlikte iki sayı eklemek için bir CodeBinaryOperatorExpression kullanımı gösterilmektedir.

// 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)

Açıklamalar

CodeBinaryOperatorExpression bir ikili işleç içeren kod ifadelerini temsil etmek için kullanılabilir. İkili işleçlere örnek olarak eşitlik (==), toplama (+) ve bit düzeyinde (|) işleçler verilebilir. Numaralandırma, CodeBinaryOperatorType birçok dilde desteklenen temel, yaygın olarak kullanılan ikili işleçlerden oluşan bir kümeyi temsil eder.

Oluşturucular

Name Description
CodeBinaryOperatorExpression()

CodeBinaryOperatorExpression sınıfının yeni bir örneğini başlatır.

CodeBinaryOperatorExpression(CodeExpression, CodeBinaryOperatorType, CodeExpression)

Belirtilen parametreleri kullanarak sınıfın CodeBinaryOperatorExpression yeni bir örneğini başlatır.

Özellikler

Name Description
Left

İşlecin solundaki kod ifadesini alır veya ayarlar.

Operator

İkili işleç ifadesindeki işleci alır veya ayarlar.

Right

İşlecin sağındaki kod ifadesini alır veya ayarlar.

UserData

Geçerli nesne için kullanıcı tarafından tanımlanabilir verileri alır.

(Devralındığı yer: CodeObject)

Yöntemler

Name Description
Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Geçerli örneğin Type alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectbasit bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

Geçerli nesneyi temsil eden bir dize döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır

Ayrıca bkz.