Delegate.CreateDelegate 메서드

정의

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

오버로드

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

지정한 대/소문자 구분과 바인딩 실패 시 지정한 동작을 기반으로 지정한 클래스 인스턴스에서 호출하는 지정한 인스턴스 메서드를 나타내는 지정한 형식의 대리자를 만듭니다.

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Object ^ target, System::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);
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

method를 바인딩할 수 없습니다. 예외가 발생하면 true이고, 예외가 발생하지 않으면 false입니다.

반환

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

예외

typenull입니다.

또는

targetnull입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

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

또는

예를 들어 찾을 수 없고 throwOnBindFailuretrue이기 때문에 method를 바인딩할 수 없습니다.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

추가 정보

적용 대상

CreateDelegate(Type, Type, String, Boolean)

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);
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

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

method
String

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

ignoreCase
Boolean

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

반환

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

예외

typenull입니다.

또는

targetnull입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

target이(가) RuntimeType가 아닌 경우

또는

target이 개방형 제네릭 형식인 경우. 즉, 해당 ContainsGenericParameters 속성이 true인 경우

또는

methodstatic 메서드(Visual Basic의 경우 Shared 메서드)가 아닌 경우

또는

예를 들어 method는 찾을 수 없기 때문에 바인딩할 수 없습니다.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

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

추가 정보

적용 대상

CreateDelegate(Type, Object, String, Boolean)

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

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

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Object ^ target, System::String ^ method, bool ignoreCase);
public static Delegate CreateDelegate (Type type, object target, string method, bool ignoreCase);
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입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

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

또는

예를 들어 method는 찾을 수 없기 때문에 바인딩할 수 없습니다.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

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

추가 정보

적용 대상

CreateDelegate(Type, Object, MethodInfo, Boolean)

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

method를 바인딩할 수 없습니다. 예외가 발생하면 true이고, 예외가 발생하지 않으면 false입니다.

반환

지정한 정적 또는 인스턴스 메서드를 나타내는 지정한 형식의 대리자이거나, throwOnBindFailurefalse이고 대리자를 method에 바인딩할 수 없으면 null입니다.

예외

typenull입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

method를 바인딩할 수 없으므로 throwOnBindFailuretrue입니다.

또는

method이(가) RuntimeMethodInfo가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

참고

첫 번째 인수를 제공하지 않는 경우 성능 향상을 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

지정한 대/소문자 구분과 바인딩 실패 시 지정한 동작을 기반으로 지정한 클래스의 지정한 정적 메서드를 나타내는 지정한 형식의 대리자를 만듭니다.

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);
public static Delegate CreateDelegate (Type type, Type target, string method, bool ignoreCase, bool throwOnBindFailure);
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

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

method
String

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

ignoreCase
Boolean

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

throwOnBindFailure
Boolean

method를 바인딩할 수 없습니다. 예외가 발생하면 true이고, 예외가 발생하지 않으면 false입니다.

반환

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

예외

typenull입니다.

또는

targetnull입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

target이(가) RuntimeType가 아닌 경우

또는

target이 개방형 제네릭 형식인 경우. 즉, 해당 ContainsGenericParameters 속성이 true인 경우

또는

methodstatic 메서드(Visual Basic의 경우 Shared 메서드)가 아닌 경우

또는

예를 들어 찾을 수 없고 throwOnBindFailuretrue이기 때문에 method를 바인딩할 수 없습니다.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

추가 정보

적용 대상

CreateDelegate(Type, MethodInfo, Boolean)

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

method를 바인딩할 수 없습니다. 예외가 발생하면 true이고, 예외가 발생하지 않으면 false입니다.

반환

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

예외

typenull입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

method를 바인딩할 수 없으므로 throwOnBindFailuretrue입니다.

또는

method이(가) RuntimeMethodInfo가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

참고

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

예제는 System.Delegate.CreateDelegate에 대한 추가 API 설명을 참조하세요.

추가 정보

적용 대상

CreateDelegate(Type, Object, String)

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

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

public:
 static Delegate ^ CreateDelegate(Type ^ type, System::Object ^ target, System::String ^ method);
public static Delegate CreateDelegate (Type type, object target, string method);
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입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

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

또는

예를 들어 method는 찾을 수 없기 때문에 바인딩할 수 없습니다.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

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

추가 정보

적용 대상

CreateDelegate(Type, Object, MethodInfo)

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

대리자가 바인드되는 개체이거나, methodstatic(Visual Basic의 경우 Shared)으로 처리하는 경우 null입니다.

method
MethodInfo

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

반환

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

예외

typenull입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

method를 바인딩할 수 없습니다.

또는

method이(가) RuntimeMethodInfo가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

참고

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

이 API에 대한 자세한 내용은 System.Delegate.CreateDelegate에 대한 추가 API 설명을 참조하세요.

추가 정보

적용 대상

CreateDelegate(Type, MethodInfo)

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입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

method를 바인딩할 수 없습니다.

또는

method이(가) RuntimeMethodInfo가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

참고

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

이 API에 대한 자세한 내용은 System.Delegate.CreateDelegate에 대한 추가 API 설명을 참조하세요.

추가 정보

적용 대상

CreateDelegate(Type, Type, String)

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);
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

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

method
String

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

반환

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

예외

typenull입니다.

또는

targetnull입니다.

또는

method이(가) null인 경우

typeMulticastDelegate를 상속하지 않습니다.

또는

type이(가) RuntimeType가 아닌 경우 리플렉션의 런타임 형식을 참조하세요.

또는

target이(가) RuntimeType가 아닌 경우

또는

target이 개방형 제네릭 형식인 경우. 즉, 해당 ContainsGenericParameters 속성이 true인 경우

또는

methodstatic 메서드(Visual Basic의 경우 Shared 메서드)가 아닌 경우

또는

예를 들어 찾을 수 없고 throwOnBindFailuretrue이기 때문에 method를 바인딩할 수 없습니다.

typeInvoke 메서드를 찾을 수 없습니다.

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

설명

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

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

추가 정보

적용 대상