예제 #1
0
 public static MvcHtmlString Td <TModel>(this HtmlHelper <TModel> htmlHelper, Ths ths, int key, string category = null)
 {
     if (ths == Mvc.Ths.Select)
     {
         ViewDataDictionary vd = new ViewDataDictionary();
         vd.Add("category", category);
         return(htmlHelper.Partial(GetTemplateName("td_select"), key, vd));
     }
     throw new NotSupportedException();
 }
예제 #2
0
        public static MvcHtmlString Th <TModel>(this HtmlHelper <TModel> htmlHelper, Ths ths, object htmlAttributes = null)
        {
            if (ths == Mvc.Ths.Select)
            {
                return(htmlHelper.Partial(GetTemplateName("th_select"), null));
            }
            ThModel th = GetThModel(ths);
            var     vd = new ViewDataDictionary();

            vd.Merge(HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
            return(htmlHelper.Partial(GetTemplateName("th"), th, ToViewData(htmlAttributes)));
        }
예제 #3
0
        private static ThModel GetThModel(Ths ths)
        {
            switch (ths)
            {
            case Mvc.Ths.Operation:
                return(new ThModel {
                    Text = ExtensionsHelper.Localize(Global, "operation", "operation")
                });

            default:
                throw new ArgumentOutOfRangeException("ths");
            }
        }