public static object CreateInstance(Type ObjectType, params object[] args) { Type NewType = GetObjType(ObjectType); if (args == null) { InstantiateObjectHandler NewMethod; if (!ListNewType.TryGetValue(NewType, out NewMethod)) { NewMethod = DynamicMethodCompiler.CreateInstantiateObjectHandler(NewType); ListNewType.Add(NewType, NewMethod); } return(NewMethod()); } else { return(Activator.CreateInstance(NewType, args)); } }