Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ CreateDelegate() [3/10]

static ? Delegate System.Delegate.CreateDelegate ( Type type,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type target,
string method,
bool ignoreCase,
bool throwOnBindFailure )
inlinestaticinherited

Definition at line 186 of file Delegate.cs.

187 {
188 if (type == null)
189 {
190 throw new ArgumentNullException("type");
191 }
192 if (target == null)
193 {
194 throw new ArgumentNullException("target");
195 }
196 if (target.ContainsGenericParameters)
197 {
198 throw new ArgumentException(SR.Arg_UnboundGenParam, "target");
199 }
200 if (method == null)
201 {
202 throw new ArgumentNullException("method");
203 }
204 if (!(type is RuntimeType runtimeType))
205 {
206 throw new ArgumentException(SR.Argument_MustBeRuntimeType, "type");
207 }
208 if (!(target is RuntimeType methodType))
209 {
210 throw new ArgumentException(SR.Argument_MustBeRuntimeType, "target");
211 }
212 if (!runtimeType.IsDelegate())
213 {
214 throw new ArgumentException(SR.Arg_MustBeDelegate, "type");
215 }
217 if (!@delegate.BindToMethodName(null, methodType, method, (DelegateBindingFlags)5 | (ignoreCase ? DelegateBindingFlags.CaselessMatching : ((DelegateBindingFlags)0))))
218 {
220 {
221 throw new ArgumentException(SR.Arg_DlgtTargMeth);
222 }
223 return null;
224 }
225 return @delegate;
226 }
static MulticastDelegate InternalAlloc(RuntimeType type)

References System.SR.Arg_DlgtTargMeth, System.SR.Arg_MustBeDelegate, System.SR.Arg_UnboundGenParam, System.SR.Argument_MustBeRuntimeType, System.Type.ContainsGenericParameters, System.Runtime.Serialization.Dictionary, System.Delegate.InternalAlloc(), and System.type.