Delegate.CreateDelegate 메서드

정의

지정된 형식의 대리자를 만듭니다.

오버로드

Name Description
CreateDelegate(Type, Object, String, Boolean, Boolean)

지정된 대/소문자 구분 및 바인딩 실패 시 지정된 동작을 사용하여 지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, Type, String, Boolean)

지정된 대/소문자 구분을 사용하여 지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, Object, String, Boolean)

지정된 대/소문자 구분을 사용하여 지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, Object, MethodInfo, Boolean)

지정된 첫 번째 인수와 바인딩 실패에 대한 지정된 동작을 사용하여 지정된 정적 또는 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, Type, String, Boolean, Boolean)

지정된 대/소문자 구분 및 바인딩 실패 시 지정된 동작을 사용하여 지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, MethodInfo, Boolean)

지정된 정적 메서드를 나타내는 지정된 형식의 대리자를 만들고 바인딩 실패에 대해 지정된 동작을 만듭니다.

CreateDelegate(Type, Object, String)

지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, Object, MethodInfo)

지정된 첫 번째 인수를 사용하여 지정된 정적 또는 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, MethodInfo)

지정된 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, Type, String)

지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

CreateDelegate(Type, Object, String, Boolean, Boolean)

Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs

지정된 대/소문자 구분 및 바인딩 실패 시 지정된 동작을 사용하여 지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Object ^ target, System::String ^ method, bool ignoreCase, bool throwOnBindFailure);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")]
public static Delegate? CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure);
public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure);
public static Delegate? CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")>]
static member CreateDelegate : Type * obj * string * bool * bool -> Delegate
static member CreateDelegate : Type * obj * string * bool * bool -> Delegate
Public Shared Function CreateDelegate (type As Type, target As Object, method As String, ignoreCase As Boolean, throwOnBindFailure As Boolean) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

target
Object

호출되는 method 클래스 인스턴스입니다.

method
String

대리자가 나타낼 인스턴스 메서드의 이름입니다.

ignoreCase
Boolean

메서드의 이름을 비교할 때 대/소문자를 무시할지 여부를 나타내는 부울입니다.

throwOnBindFailure
Boolean

바인딩할 수 없는 경우 예외를 throw하려면 그렇지 않으면 .입니다.

반품

지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자입니다.

특성

예외

typenull입니다.

-또는-

targetnull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

method 가 인스턴스 메서드가 아닙니다.

-또는-

method 은 바인딩할 수 없습니다. 예를 들어 찾을 throwOnBindFailure 수 없고 ,입니다 true.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드는 인스턴스 메서드에 대해서만 대리자를 만듭니다. 인스턴스 메서드는 클래스의 인스턴스와 연결된 메서드입니다. 정적 메서드는 클래스 자체와 연결된 메서드입니다.

추가 정보

적용 대상

CreateDelegate(Type, Type, String, Boolean)

Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs

지정된 대/소문자 구분을 사용하여 지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, Type ^ target, System::String ^ method, bool ignoreCase);
public static Delegate CreateDelegate(Type type, Type target, string method, bool ignoreCase);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")]
public static Delegate CreateDelegate(Type type, Type target, string method, bool ignoreCase);
static member CreateDelegate : Type * Type * string * bool -> Delegate
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")>]
static member CreateDelegate : Type * Type * string * bool -> Delegate
Public Shared Function CreateDelegate (type As Type, target As Type, method As String, ignoreCase As Boolean) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

target
Type

Type 를 구현하는 클래스를 나타내는 형식입니다method.

method
String

대리자가 나타낼 정적 메서드의 이름입니다.

ignoreCase
Boolean

메서드의 이름을 비교할 때 대/소문자를 무시할지 여부를 나타내는 부울입니다.

반품

지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자입니다.

특성

예외

typenull입니다.

-또는-

targetnull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

target 가 아닙니다 RuntimeType.

-또는-

target 는 열린 제네릭 형식입니다. 즉, 해당 ContainsGenericParameters 속성은 .입니다 true.

-또는-

method static 메서드(Visual Basic Shared 메서드)가 아닙니다.

-또는-

method 예를 들어 찾을 수 없으므로 바인딩할 수 없습니다.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드는 정적 메서드에 대해서만 대리자를 만듭니다. 인스턴스 메서드는 클래스의 인스턴스와 연결된 메서드입니다. 정적 메서드는 클래스 자체와 연결된 메서드입니다.

이 메서드 오버로드는 메서드 오버로드를 CreateDelegate(Type, Type, String, Boolean, Boolean) 호출하고 에 대해 throwOnBindFailure지정하는 것과 true 같습니다.

추가 정보

적용 대상

CreateDelegate(Type, Object, String, Boolean)

Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs

지정된 대/소문자 구분을 사용하여 지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Object ^ target, System::String ^ method, bool ignoreCase);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")]
public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase);
public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")>]
static member CreateDelegate : Type * obj * string * bool -> Delegate
static member CreateDelegate : Type * obj * string * bool -> Delegate
Public Shared Function CreateDelegate (type As Type, target As Object, method As String, ignoreCase As Boolean) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

target
Object

호출되는 method 클래스 인스턴스입니다.

method
String

대리자가 나타낼 인스턴스 메서드의 이름입니다.

ignoreCase
Boolean

메서드의 이름을 비교할 때 대/소문자를 무시할지 여부를 나타내는 부울입니다.

반품

지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자입니다.

특성

예외

typenull입니다.

-또는-

targetnull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

method 가 인스턴스 메서드가 아닙니다.

-또는-

method 예를 들어 찾을 수 없으므로 바인딩할 수 없습니다.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드는 인스턴스 메서드에 대해서만 대리자를 만듭니다. 인스턴스 메서드는 클래스의 인스턴스와 연결된 메서드입니다. 정적 메서드는 클래스 자체와 연결된 메서드입니다.

이 메서드 오버로드는 메서드 오버로드를 CreateDelegate(Type, Object, String, Boolean, Boolean) 호출하고 에 대해 throwOnBindFailure지정하는 것과 true 같습니다.

추가 정보

적용 대상

CreateDelegate(Type, Object, MethodInfo, Boolean)

Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs

지정된 첫 번째 인수와 바인딩 실패에 대한 지정된 동작을 사용하여 지정된 정적 또는 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Object ^ firstArgument, System::Reflection::MethodInfo ^ method, bool throwOnBindFailure);
public static Delegate? CreateDelegate(Type type, object? firstArgument, System.Reflection.MethodInfo method, bool throwOnBindFailure);
public static Delegate CreateDelegate(Type type, object firstArgument, System.Reflection.MethodInfo method, bool throwOnBindFailure);
static member CreateDelegate : Type * obj * System.Reflection.MethodInfo * bool -> Delegate
Public Shared Function CreateDelegate (type As Type, firstArgument As Object, method As MethodInfo, throwOnBindFailure As Boolean) As Delegate

매개 변수

type
Type

Type 만들 대리자의 형식을 나타내는 형식입니다.

firstArgument
Object

Object 대리자가 나타내는 메서드의 첫 번째 인수입니다. 인스턴스 메서드의 경우 인스턴스 형식과 호환되어야 합니다.

method
MethodInfo

MethodInfo 대리자가 나타내는 정적 또는 인스턴스 메서드를 설명하는 것입니다.

throwOnBindFailure
Boolean

바인딩할 수 없는 경우 예외를 throw하려면 그렇지 않으면 .입니다.

반품

지정된 정적 또는 인스턴스 메서드를 나타내는 지정된 형식의 대리자이거나 null , 있는 경우 throwOnBindFailurefalse 대리자를 바인딩할 method수 없습니다.

예외

typenull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

method 은 바인딩 throwOnBindFailuretrue할 수 없으며

-또는-

method 가 아닙니다 RuntimeMethodInfo.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드 오버로드 및 CreateDelegate(Type, Object, MethodInfo) 바인딩 실패에 항상 throw되는 메서드 오버로드는 대리자를 만드는 가장 유연한 방법을 제공합니다. 이를 사용하여 첫 번째 인수를 사용하거나 사용하지 않고 정적 또는 인스턴스 메서드에 대한 대리자를 만들 수 있습니다.

메모

첫 번째 인수를 제공하지 않는 경우 성능 향상을 CreateDelegate(Type, MethodInfo, Boolean) 위해 메서드 오버로드를 사용합니다.

자세한 내용 및 예제는 System.Delegate.CreateDelegate에 대한 추가 API 비고를 참조하세요.

추가 정보

적용 대상

CreateDelegate(Type, Type, String, Boolean, Boolean)

Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs

지정된 대/소문자 구분 및 바인딩 실패 시 지정된 동작을 사용하여 지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, Type ^ target, System::String ^ method, bool ignoreCase, bool throwOnBindFailure);
public static Delegate? CreateDelegate(Type type, Type target, string method, bool ignoreCase, bool throwOnBindFailure);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")]
public static Delegate? CreateDelegate(Type type, Type target, string method, bool ignoreCase, bool throwOnBindFailure);
public static Delegate CreateDelegate(Type type, Type target, string method, bool ignoreCase, bool throwOnBindFailure);
static member CreateDelegate : Type * Type * string * bool * bool -> Delegate
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")>]
static member CreateDelegate : Type * Type * string * bool * bool -> Delegate
Public Shared Function CreateDelegate (type As Type, target As Type, method As String, ignoreCase As Boolean, throwOnBindFailure As Boolean) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

target
Type

Type 를 구현하는 클래스를 나타내는 형식입니다method.

method
String

대리자가 나타낼 정적 메서드의 이름입니다.

ignoreCase
Boolean

메서드의 이름을 비교할 때 대/소문자를 무시할지 여부를 나타내는 부울입니다.

throwOnBindFailure
Boolean

바인딩할 수 없는 경우 예외를 throw하려면 그렇지 않으면 .입니다.

반품

지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자입니다.

특성

예외

typenull입니다.

-또는-

targetnull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

target 가 아닙니다 RuntimeType.

-또는-

target 는 열린 제네릭 형식입니다. 즉, 해당 ContainsGenericParameters 속성은 .입니다 true.

-또는-

method static 메서드(Visual Basic Shared 메서드)가 아닙니다.

-또는-

method 은 바인딩할 수 없습니다. 예를 들어 찾을 throwOnBindFailure 수 없고 ,입니다 true.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드는 정적 메서드에 대해서만 대리자를 만듭니다. 인스턴스 메서드는 클래스의 인스턴스와 연결된 메서드입니다. 정적 메서드는 클래스 자체와 연결된 메서드입니다.

추가 정보

적용 대상

CreateDelegate(Type, MethodInfo, Boolean)

Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs
Source:
Delegate.CoreCLR.cs

지정된 정적 메서드를 나타내는 지정된 형식의 대리자를 만들고 바인딩 실패에 대해 지정된 동작을 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Reflection::MethodInfo ^ method, bool throwOnBindFailure);
public static Delegate? CreateDelegate(Type type, System.Reflection.MethodInfo method, bool throwOnBindFailure);
public static Delegate CreateDelegate(Type type, System.Reflection.MethodInfo method, bool throwOnBindFailure);
static member CreateDelegate : Type * System.Reflection.MethodInfo * bool -> Delegate
Public Shared Function CreateDelegate (type As Type, method As MethodInfo, throwOnBindFailure As Boolean) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

method
MethodInfo

MethodInfo 대리자가 나타내는 정적 또는 인스턴스 메서드를 설명하는 것입니다.

throwOnBindFailure
Boolean

바인딩할 수 없는 경우 예외를 throw하려면 그렇지 않으면 .입니다.

반품

지정된 정적 메서드를 나타내는 지정된 형식의 대리자입니다.

예외

typenull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

method 은 바인딩 throwOnBindFailuretrue할 수 없으며

-또는-

method 가 아닙니다 RuntimeMethodInfo.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드 오버로드는 열려 있는 정적 메서드 대리자를 만들고 인스턴스 메서드 대리자를 열 수 있습니다. 즉, 인스턴스 메서드의 숨겨진 첫 번째 인수를 노출하는 대리자입니다. 자세한 설명은 인스턴스 또는 정적 메서드에 대해 열려 있거나 닫힌 대리자의 모든 조합을 만들 수 있는 보다 일반적인 CreateDelegate(Type, Object, MethodInfo, Boolean) 메서드 오버로드를 참조하세요.

메모

대리자가 첫 번째 인수를 통해 닫혀 있지 않은 경우 이 메서드 오버로드를 사용해야 합니다. 이 경우 다소 빠르기 때문입니다.

예제는 System.Delegate.CreateDelegate에 대한 추가 API 비고를 참조하세요.

추가 정보

적용 대상

CreateDelegate(Type, Object, String)

Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs

지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Object ^ target, System::String ^ method);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")]
public static Delegate CreateDelegate(Type type, object target, string method);
public static Delegate CreateDelegate(Type type, object target, string method);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")>]
static member CreateDelegate : Type * obj * string -> Delegate
static member CreateDelegate : Type * obj * string -> Delegate
Public Shared Function CreateDelegate (type As Type, target As Object, method As String) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

target
Object

호출되는 method 클래스 인스턴스입니다.

method
String

대리자가 나타낼 인스턴스 메서드의 이름입니다.

반품

지정된 클래스 인스턴스에서 호출할 지정된 인스턴스 메서드를 나타내는 지정된 형식의 대리자입니다.

특성

예외

typenull입니다.

-또는-

targetnull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

method 가 인스턴스 메서드가 아닙니다.

-또는-

method 예를 들어 찾을 수 없으므로 바인딩할 수 없습니다.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드는 인스턴스 메서드에 대해서만 대리자를 만듭니다. 인스턴스 메서드는 클래스의 인스턴스와 연결된 메서드입니다. 정적 메서드는 클래스 자체와 연결된 메서드입니다.

이 메서드 오버로드는 메서드 오버로드를 CreateDelegate(Type, Object, String, Boolean, Boolean) 호출하고 에 대해 ignoreCasetruethrowOnBindFailure지정하는 것과 false 같습니다.

추가 정보

적용 대상

CreateDelegate(Type, Object, MethodInfo)

Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs

지정된 첫 번째 인수를 사용하여 지정된 정적 또는 인스턴스 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Object ^ firstArgument, System::Reflection::MethodInfo ^ method);
public static Delegate CreateDelegate(Type type, object? firstArgument, System.Reflection.MethodInfo method);
public static Delegate CreateDelegate(Type type, object firstArgument, System.Reflection.MethodInfo method);
static member CreateDelegate : Type * obj * System.Reflection.MethodInfo -> Delegate
Public Shared Function CreateDelegate (type As Type, firstArgument As Object, method As MethodInfo) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

firstArgument
Object

대리자가 바인딩된 개체이거나 nullmethodstatic(Visual Basic Shared)로 처리합니다.

method
MethodInfo

MethodInfo 대리자가 나타내는 정적 또는 인스턴스 메서드를 설명하는 것입니다.

반품

지정된 정적 또는 인스턴스 메서드를 나타내는 지정된 형식의 대리자입니다.

예외

typenull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

method 바인딩할 수 없습니다.

-또는-

method 가 아닙니다 RuntimeMethodInfo.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드 오버로드를 호출하는 것은 메서드 오버로드를 CreateDelegate(Type, Object, MethodInfo, Boolean) 호출하고 에 대해 throwOnBindFailure지정하는 것과 true 같습니다. 이러한 두 오버로드는 대리자를 만드는 가장 유연한 방법을 제공합니다. 이를 사용하여 정적 또는 인스턴스 메서드에 대한 대리자를 만들고 필요에 따라 첫 번째 인수를 지정할 수 있습니다.

메모

첫 번째 인수를 제공하지 않는 경우 성능 향상을 CreateDelegate(Type, MethodInfo) 위해 메서드 오버로드를 사용합니다.

이 API에 대한 자세한 내용은 System.Delegate.CreateDelegate에 대한 추가 API 비고를 참조하세요.

추가 정보

적용 대상

CreateDelegate(Type, MethodInfo)

Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs

지정된 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Reflection::MethodInfo ^ method);
public static Delegate CreateDelegate(Type type, System.Reflection.MethodInfo method);
static member CreateDelegate : Type * System.Reflection.MethodInfo -> Delegate
Public Shared Function CreateDelegate (type As Type, method As MethodInfo) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

method
MethodInfo

MethodInfo 대리자가 나타내는 정적 또는 인스턴스 메서드를 설명하는 것입니다.

반품

지정된 메서드를 나타내는 지정된 형식의 대리자입니다.

예외

typenull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

method 바인딩할 수 없습니다.

-또는-

method 가 아닙니다 RuntimeMethodInfo.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 오버로드는 정적 메서드에 대한 대리자를 만들고 인스턴스 메서드 대리자를 열 수 있습니다. 즉, 인스턴스 메서드의 숨겨진 첫 번째 인수를 명시적으로 제공하는 대리자입니다. 자세한 설명은 인스턴스 또는 정적 메서드에 대해 열려 있거나 닫힌 대리자의 모든 조합을 만들고 선택적으로 첫 번째 인수를 지정할 수 있는 보다 일반적인 CreateDelegate(Type, Object, MethodInfo) 메서드 오버로드를 참조하세요.

메모

대리자가 첫 번째 인수를 통해 닫혀 있지 않은 경우 이 메서드 오버로드를 사용해야 합니다. 이 경우 다소 빠르기 때문입니다.

이 API에 대한 자세한 내용은 System.Delegate.CreateDelegate에 대한 추가 API 비고를 참조하세요.

추가 정보

적용 대상

CreateDelegate(Type, Type, String)

Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs
Source:
Delegate.cs

지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, Type ^ target, System::String ^ method);
public static Delegate CreateDelegate(Type type, Type target, string method);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")]
public static Delegate CreateDelegate(Type type, Type target, string method);
static member CreateDelegate : Type * Type * string -> Delegate
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The target method might be removed")>]
static member CreateDelegate : Type * Type * string -> Delegate
Public Shared Function CreateDelegate (type As Type, target As Type, method As String) As Delegate

매개 변수

type
Type

Type 만들 대리자의 수입니다.

target
Type

Type 를 구현하는 클래스를 나타내는 형식입니다method.

method
String

대리자가 나타낼 정적 메서드의 이름입니다.

반품

지정된 클래스의 지정된 정적 메서드를 나타내는 지정된 형식의 대리자입니다.

특성

예외

typenull입니다.

-또는-

targetnull입니다.

-또는-

methodnull입니다.

type 은 상속 MulticastDelegate되지 않습니다.

-또는-

type 가 아닙니다 RuntimeType.

-또는-

target 가 아닙니다 RuntimeType.

-또는-

target 는 열린 제네릭 형식입니다. 즉, 해당 ContainsGenericParameters 속성은 .입니다 true.

-또는-

method static 메서드(Visual Basic Shared 메서드)가 아닙니다.

메서드 Invoketype 찾을 수 없습니다.

호출자에게 액세스 method하는 데 필요한 권한이 없습니다.

설명

이 메서드는 정적 메서드에 대해서만 대리자를 만듭니다. 인스턴스 메서드는 클래스의 인스턴스와 연결된 메서드입니다. 정적 메서드는 클래스 자체와 연결된 메서드입니다.

이 메서드 오버로드는 메서드 오버로드를 CreateDelegate(Type, Type, String, Boolean, Boolean) 호출하고 에 대해 ignoreCasetruethrowOnBindFailure지정하는 것과 false 같습니다.

추가 정보

적용 대상