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

◆ CreateInstanceOfT()

object System.RuntimeType.CreateInstanceOfT ( )
inlinepackage

Definition at line 3220 of file RuntimeType.cs.

3221 {
3222 ActivatorCache activatorCache = GenericCache as ActivatorCache;
3223 if (activatorCache == null)
3224 {
3225 activatorCache = (ActivatorCache)(GenericCache = new ActivatorCache(this));
3226 }
3227 if (!activatorCache.CtorIsPublic)
3228 {
3229 throw new MissingMethodException(SR.Format(SR.Arg_NoDefCTor, this));
3230 }
3231 object obj = activatorCache.CreateUninitializedObject(this);
3232 try
3233 {
3234 activatorCache.CallConstructor(obj);
3235 return obj;
3236 }
3237 catch (Exception inner)
3238 {
3239 throw new TargetInvocationException(inner);
3240 }
3241 }

References System.SR.Arg_NoDefCTor, System.SR.Format(), System.RuntimeType.GenericCache, and System.obj.