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

◆ CreateDelegateNoSecurityCheck()

static Delegate System.Delegate.CreateDelegateNoSecurityCheck ( Type type,
object target,
RuntimeMethodHandle method )
inlinestaticpackageinherited

Definition at line 288 of file Delegate.cs.

289 {
290 if (type == null)
291 {
292 throw new ArgumentNullException("type");
293 }
294 if (method.IsNullHandle())
295 {
296 throw new ArgumentNullException("method");
297 }
298 if (!(type is RuntimeType runtimeType))
299 {
300 throw new ArgumentException(SR.Argument_MustBeRuntimeType, "type");
301 }
302 if (!runtimeType.IsDelegate())
303 {
304 throw new ArgumentException(SR.Arg_MustBeDelegate, "type");
305 }
307 if (!@delegate.BindToMethodInfo(target, method.GetMethodInfo(), RuntimeMethodHandle.GetDeclaringType(method.GetMethodInfo()), DelegateBindingFlags.RelaxedSignature))
308 {
309 throw new ArgumentException(SR.Arg_DlgtTargMeth);
310 }
311 return @delegate;
312 }
static MulticastDelegate InternalAlloc(RuntimeType type)

References System.SR.Arg_DlgtTargMeth, System.SR.Arg_MustBeDelegate, System.SR.Argument_MustBeRuntimeType, System.Runtime.Serialization.Dictionary, System.RuntimeMethodHandle.GetDeclaringType(), System.Delegate.InternalAlloc(), and System.type.

Referenced by System.Reflection.Emit.DynamicMethod.CreateDelegate(), and System.Reflection.Emit.DynamicMethod.CreateDelegate().