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

◆ CreateDelegate() [8/10]

static ? Delegate System.Delegate.CreateDelegate ( Type type,
object target,
string method,
bool ignoreCase,
bool throwOnBindFailure )
inlinestaticinherited

Definition at line 152 of file Delegate.cs.

153 {
154 if (type == null)
155 {
156 throw new ArgumentNullException("type");
157 }
158 if (target == null)
159 {
160 throw new ArgumentNullException("target");
161 }
162 if (method == null)
163 {
164 throw new ArgumentNullException("method");
165 }
166 if (!(type is RuntimeType runtimeType))
167 {
168 throw new ArgumentException(SR.Argument_MustBeRuntimeType, "type");
169 }
170 if (!runtimeType.IsDelegate())
171 {
172 throw new ArgumentException(SR.Arg_MustBeDelegate, "type");
173 }
175 if (!@delegate.BindToMethodName(target, (RuntimeType)target.GetType(), method, (DelegateBindingFlags)26 | (ignoreCase ? DelegateBindingFlags.CaselessMatching : ((DelegateBindingFlags)0))))
176 {
178 {
179 throw new ArgumentException(SR.Arg_DlgtTargMeth);
180 }
181 return null;
182 }
183 return @delegate;
184 }
static MulticastDelegate InternalAlloc(RuntimeType type)

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

Referenced by ReLogic.Peripherals.RGB.ChromaShader.BindProcessors(), System.Data.DataRowExtensions.UnboxT< T >.Create(), System.Xml.Xsl.IlGen.XmlILModule.CreateDelegate(), System.Delegate.CreateDelegate(), System.Delegate.CreateDelegate(), System.Delegate.CreateDelegate(), System.Delegate.CreateDelegate(), System.Delegate.CreateDelegate(), System.Delegate.CreateDelegate(), System.Text.Json.Serialization.Metadata.FSharpCoreReflectionProxy.CreateDelegate< TDelegate >(), System.Resources.ResourceReader.CreateUntypedDelegate< TInstance >(), and Internal.Runtime.InteropServices.ComponentActivator.InternalGetFunctionPointer().