Esempio n. 1
0
        public ActionMethod(MethodInfo methodInfo)
        {
            _methodInfo = methodInfo;

            _filterAttributes = (ActionFilterAttribute[])methodInfo.GetCustomAttributes(typeof(ActionFilterAttribute), false);

            OrderedAttribute.Sort(_filterAttributes);

            if (_methodInfo.IsDefined(typeof(LayoutAttribute), false))
            {
                _defaultLayoutName = ((LayoutAttribute)_methodInfo.GetCustomAttributes(typeof(LayoutAttribute), false)[0]).LayoutName ?? "";
            }

            if (_methodInfo.IsDefined(typeof(ViewAttribute), false))
            {
                _defaultViewName = ((ViewAttribute)_methodInfo.GetCustomAttributes(typeof(ViewAttribute), false)[0]).ViewName ?? "";
            }
        }
 internal static void Sort(OrderedAttribute[] attributes)
 {
     Array.Sort(attributes, (att1, att2) => att1.Order - att2.Order);
 }