예제 #1
0
        public static T Create <T>(ViewResolver viewResolver, ExceptionReportInfo reportInfo) where T : class
        {
            var view = viewResolver.Resolve <T>();

            var constructor = view.GetConstructor(new[] { typeof(ExceptionReportInfo) });
            var newInstance = constructor.Invoke(new object[] { reportInfo });

            return(newInstance as T);
        }
예제 #2
0
 public static T Create <T>(ViewResolver viewResolver) where T : class
 {
     return(Activator.CreateInstance(viewResolver.Resolve <T>()) as T);
 }