Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateDelegate() [10/10]

static ? Delegate System.Delegate.CreateDelegate ( Type type,
object? firstArgument,
MethodInfo method,
bool throwOnBindFailure )
inlinestaticinherited

Definition at line 258 of file Delegate.cs.

259 {
260 if (type == null)
261 {
262 throw new ArgumentNullException("type");
263 }
264 if (method == null)
265 {
266 throw new ArgumentNullException("method");
267 }
268 if (!(type is RuntimeType runtimeType))
269 {
270 throw new ArgumentException(SR.Argument_MustBeRuntimeType, "type");
271 }
273 {
274 throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, "method");
275 }
276 if (!runtimeType.IsDelegate())
277 {
278 throw new ArgumentException(SR.Arg_MustBeDelegate, "type");
279 }
281 if ((object)@delegate == null && throwOnBindFailure)
282 {
283 throw new ArgumentException(SR.Arg_DlgtTargMeth);
284 }
285 return @delegate;
286 }
static Delegate CreateDelegateInternal(RuntimeType rtType, RuntimeMethodInfo rtMethod, object firstArgument, DelegateBindingFlags flags)
Definition Delegate.cs:314

References System.SR.Arg_DlgtTargMeth, System.SR.Arg_MustBeDelegate, System.SR.Argument_MustBeRuntimeMethodInfo, System.SR.Argument_MustBeRuntimeType, System.Delegate.CreateDelegateInternal(), System.Runtime.Serialization.Dictionary, and System.type.