private object CreateSingleton(params object[] parameters) { // Simple lock to prevent 2 different threads from // trying to store a singleton at the same time lock (locker) { // If Instance isn't null then another thread // already stored an instance. if (Instance == null) { Instance = CtorInfo.Invoke(parameters); } } return(Instance); }
public override object MarshalNativeToManaged(IntPtr p) => CtorInfo.Invoke(new object[] { p, true });
private object CreateTransient(params object[] parameters) { return(CtorInfo.Invoke(parameters)); }