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

◆ CreateInstanceDefaultCtor()

object System.RuntimeType.CreateInstanceDefaultCtor ( bool publicOnly,
bool wrapExceptions )
inlinepackage

Definition at line 3195 of file RuntimeType.cs.

3196 {
3197 ActivatorCache activatorCache = GenericCache as ActivatorCache;
3198 if (activatorCache == null)
3199 {
3200 activatorCache = (ActivatorCache)(GenericCache = new ActivatorCache(this));
3201 }
3202 if (!activatorCache.CtorIsPublic && publicOnly)
3203 {
3204 throw new MissingMethodException(SR.Format(SR.Arg_NoDefCTor, this));
3205 }
3206 object obj = activatorCache.CreateUninitializedObject(this);
3207 try
3208 {
3209 activatorCache.CallConstructor(obj);
3210 return obj;
3211 }
3212 catch (Exception inner) when (wrapExceptions)
3213 {
3214 throw new TargetInvocationException(inner);
3215 }
3216 }

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

Referenced by System.RuntimeType.CreateInstanceImpl().