首页新闻找找看学习计划

Activator.CreateInstance(resultListGenericType, viewModel, queryOptions); 这?

0
[已关闭问题] 关闭于 2016-06-18 19:17

CreateInstance  里面的参数解释很多 啥子意思

问题补充:

//
// Summary:
// Creates an instance of the specified type using the constructor that best matches
// the specified parameters.
//
// Parameters:
// type:
// The type of object to create.
//
// args:
// An array of arguments that match in number, order, and type the parameters of
// the constructor to invoke. If args is an empty array or null, the constructor
// that takes no parameters (the default constructor) is invoked.
//
// Returns:
// A reference to the newly created object.
//
// Exceptions:
// T:System.ArgumentNullException:
// type is null.
//
// T:System.ArgumentException:
// type is not a RuntimeType. -or-type is an open generic type (that is, the System.Type.ContainsGenericParameters
// property returns true).
//
// T:System.NotSupportedException:
// type cannot be a System.Reflection.Emit.TypeBuilder.-or- Creation of System.TypedReference,
// System.ArgIterator, System.Void, and System.RuntimeArgumentHandle types, or arrays
// of those types, is not supported. -or-The assembly that contains type is a dynamic
// assembly that was created with System.Reflection.Emit.AssemblyBuilderAccess.Save.-or-The
// constructor that best matches args has varargs arguments.
//
// T:System.Reflection.TargetInvocationException:
// The constructor being called throws an exception.
//
// T:System.MethodAccessException:
// NoteIn the .NET for Windows Store apps or the Portable Class Library, catch the
// base class exception, System.MemberAccessException, instead.The caller does not
// have permission to call this constructor.
//
// T:System.MemberAccessException:
// Cannot create an instance of an abstract class, or this member was invoked with
// a late-binding mechanism.
//
// T:System.Runtime.InteropServices.InvalidComObjectException:
// The COM type was not obtained through Overload:System.Type.GetTypeFromProgID
// or Overload:System.Type.GetTypeFromCLSID.
//
// T:System.MissingMethodException:
// NoteIn the .NET for Windows Store apps or the Portable Class Library, catch the
// base class exception, System.MissingMemberException, instead.No matching public
// constructor was found.
//
// T:System.Runtime.InteropServices.COMException:
// type is a COM object but the class identifier used to obtain the type is invalid,
// or the identified class is not registered.
//
// T:System.TypeLoadException:
// type is not a valid type.

烂屁股猴即将追回前任的主页 烂屁股猴即将追回前任 | 小虾三级 | 园豆:897
提问于:2016-06-18 16:33
< >
分享
所有回答(1)
0

上面啊是它的注释

烂屁股猴即将追回前任 | 园豆:897 (小虾三级) | 2016-06-18 16:34
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册