CodeBaseReferenceExpression クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
基底クラスへの参照を表します。
public ref 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
[<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 を使用して基底クラス メソッドを参照する方法を示します。
// 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) |