internal static T Create <T>(string args) where T : IMyType { IMyType newThing = (T)typeof(T).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.DefaultBinder, Type.EmptyTypes, null).Invoke(null); newThing.Initialise(args); return((T)newThing); }
internal static T Create <T>(string args) where T : IMyType { IMyType newThing = (T)typeof(T).GetMethod("GetInstance").Invoke(default(object), null); newThing.Initialise(args); return((T)newThing); }