コード例 #1
0
        public static void SignalExceptionToElmahAndTrace(Exception ex, System.Web.Mvc.Controller lui)
        {
            MyTracer.MyTrace(
                System.Diagnostics.TraceLevel.Error,
                lui.GetType(),
                lui.ControllerContext.RouteData.Values["controller"].ToString(),
                lui.ControllerContext.RouteData.Values["action"].ToString(),
                ex.Message, ex);

            //Elmah.ErrorSignal.FromCurrentContext().Raise(ex); //ELMAH Signaling
        }
コード例 #2
0
        public DHXScheduler(System.Web.Mvc.Controller parent)
            : this()
        {
            string name   = parent.GetType().Name;
            int    length = nameof(Controller).Length;

            if (name.Length > length && name.EndsWith(nameof(Controller)))
            {
                this.Controller = name.Substring(0, name.Length - length);
            }
            else
            {
                this.Controller = name;
            }
        }
コード例 #3
0
        public static List <string> GetViewsName(this System.Web.Mvc.Controller controller)
        {
            var cType = controller.GetType();

            return(cType.GetUserDefinedMethodsName().Distinct().ToList());
        }