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

◆ CreateDelegate() [5/10]

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

Definition at line 228 of file Delegate.cs.

229 {
230 if (type == null)
231 {
232 throw new ArgumentNullException("type");
233 }
234 if (method == null)
235 {
236 throw new ArgumentNullException("method");
237 }
238 if (!(type is RuntimeType runtimeType))
239 {
240 throw new ArgumentException(SR.Argument_MustBeRuntimeType, "type");
241 }
243 {
244 throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, "method");
245 }
246 if (!runtimeType.IsDelegate())
247 {
248 throw new ArgumentException(SR.Arg_MustBeDelegate, "type");
249 }
251 if ((object)@delegate == null && throwOnBindFailure)
252 {
253 throw new ArgumentException(SR.Arg_DlgtTargMeth);
254 }
255 return @delegate;
256 }
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.