DynamicMethod.DeclaringType 속성

정의

동적 메서드에 대해 항상 null 인 메서드를 선언하는 형식을 가져옵니다.

public:
 virtual property Type ^ DeclaringType { Type ^ get(); };
public override Type? DeclaringType { get; }
public override Type DeclaringType { get; }
member this.DeclaringType : Type
Public Overrides ReadOnly Property DeclaringType As Type

속성 값

Type

항상 null입니다.

예제

다음 코드 예제에서는 동적 메서드의 선언 형식을 표시 합니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DynamicMethod 클래스입니다.

// Display the declaring type, which is always null for dynamic
// methods.
if (hello->DeclaringType == nullptr)
{
    Console::WriteLine("\r\nDeclaringType is always null for dynamic methods.");
}
else
{
    Console::WriteLine("DeclaringType: {0}", hello->DeclaringType);
}
// Display the declaring type, which is always null for dynamic
// methods.
if (hello.DeclaringType == null)
{
    Console.WriteLine("\r\nDeclaringType is always null for dynamic methods.");
}
else
{
    Console.WriteLine("DeclaringType: {0}", hello.DeclaringType);
}
' Display the declaring type, which is always Nothing for dynamic
' methods.
If hello.DeclaringType Is Nothing Then
    Console.WriteLine(vbCrLf & "DeclaringType is always Nothing for dynamic methods.")
Else
    Console.WriteLine("DeclaringType: {0}", hello.DeclaringType)
End If

설명

이 속성은 항상 동적 메서드에 대해 반환 null 됩니다. 동적 메서드가 형식과 논리적으로 연결된 경우에도 형식에 의해 선언되지 않습니다.

적용 대상