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)

적용 대상