CodeBaseReferenceExpression クラス

定義

基本クラスの参照を表します。

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

この例では、 を CodeBaseReferenceExpression 使用して基底クラス メソッドを参照する方法を示します。

// Example method invoke expression uses CodeBaseReferenceExpression to produce
// a base.Dispose method call
CodeMethodInvokeExpression^ methodInvokeExpression = 
   gcnew CodeMethodInvokeExpression(              // Creates a method invoke expression
      gcnew CodeBaseReferenceExpression,          // targetObjectparameter can be a base class reference
      "Dispose",gcnew array<CodeExpression^>{} ); // Method name and method parameter arguments

// A C# code generator produces the following source code for the preceeding example code:
// base.Dispose();
// Example method invoke expression uses CodeBaseReferenceExpression to produce
// a base.Dispose method call
CodeMethodInvokeExpression methodInvokeExpression =

    // Creates a method invoke expression
    new CodeMethodInvokeExpression(

    // targetObject parameter can be a
    // base class reference
    new CodeBaseReferenceExpression(),

    // Method name and method parameter arguments
    "Dispose", new CodeExpression[] {});

// A C# code generator produces the following source code for the preceeding example code:

// base.Dispose();
' Example method invoke expression uses CodeBaseReferenceExpression to produce 
' a base.Dispose method call
Dim methodInvokeExpression As New CodeMethodInvokeExpression( New CodeBaseReferenceExpression(), "Dispose", New CodeExpression() {})    

' A Visual Basic code generator produces the following source code for the preceeding example code:

' MyBase.Dispose

注釈

CodeBaseReferenceExpression は、現在のクラスの基底クラスへの参照を表します。 基底クラスは、親クラスまたはスーパー クラスとも呼ばれます。 基底クラスへの参照は、そのメソッドまたはプロパティの基底クラスの実装を呼び出すために、メソッドまたはプロパティをオーバーライドするときによく使用されます。 たとえば、基底クラス ToString の メソッドの末尾に文字列を追加する ToString メソッドのオーバーライドでは、base が呼び出されます。C# の ToString()

コンストラクター

CodeBaseReferenceExpression()

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

プロパティ

UserData

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

(継承元 CodeObject)

メソッド

Equals(Object)

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

(継承元 Object)
GetHashCode()

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

(継承元 Object)
GetType()

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

(継承元 Object)
MemberwiseClone()

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

(継承元 Object)
ToString()

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

(継承元 Object)

適用対象