Example #1
0
 public virtual void WriteBody(TextWriter writer, Tab first, TypeContext context)
 {
     using (TabContainer.Surround(writer, new HtmlTag("div", context.Compose(this.Id)).Class("tab-pane fade").Class(this == first ? "in active" : null)))
         this.Body.WriteTo(writer);
 }
Example #2
0
 public TabContainer(HtmlHelper helper, TypeContext context, string containerId)
 {
     this.helper      = helper;
     this.context     = context;
     this.containerId = containerId;
 }
 public static MvcHtmlString EntityListDetail <T, S>(this HtmlHelper helper, TypeContext <T> tc, Expression <Func <T, MList <S> > > property)
 {
     return(helper.EntityListDetail <T, S>(tc, property, null));
 }
Example #4
0
 public virtual void WriteHeader(TextWriter writer, Tab first, TypeContext context)
 {
     using (TabContainer.Surround(writer, new HtmlTag("li").Class(this == first ? "active" : null)))
         using (TabContainer.Surround(writer, new HtmlTag("a").Attr("href", "#" + context.Compose(this.Id)).Attr("data-toggle", "tab").Attr("title", this.ToolTip)))
             this.Title.WriteTo(writer);
 }
        List <Tab> IViewOverrides.ExpandTabs(List <Tab> tabs, string containerId, HtmlHelper helper, TypeContext context)
        {
            if (hiddenTabs != null && hiddenTabs.Contains(containerId))
            {
                return(null);
            }

            List <Tab> newTabs = new List <Tab>();

            var before = BeforeTabDictionary?.TryGetC(containerId);

            if (before != null)
            {
                foreach (var b in before.GetInvocationListTyped())
                {
                    var newTab = b(helper, context);
                    if (newTab != null)
                    {
                        ExpandTab(newTab, helper, context, newTabs);
                    }
                }
            }

            foreach (var item in tabs)
            {
                ExpandTab(item, helper, context, newTabs);
            }

            var after = AfterTabDictionary?.TryGetC(containerId);

            if (after != null)
            {
                foreach (var a in after.GetInvocationListTyped())
                {
                    var newTab = a(helper, context);
                    if (newTab != null)
                    {
                        ExpandTab(newTab, helper, context, newTabs);
                    }
                }
            }

            return(newTabs);
        }
        MvcHtmlString IViewOverrides.OnSurroundLine(PropertyRoute propertyRoute, HtmlHelper helper, TypeContext tc, MvcHtmlString result)
        {
            var before = beforeLine?.TryGetC(propertyRoute);

            if (before != null)
            {
                foreach (var b in before.GetInvocationListTyped())
                {
                    result = b(helper, tc).Concat(result);
                }
            }

            var after = afterLine?.TryGetC(propertyRoute);

            if (after != null)
            {
                foreach (var a in after.GetInvocationListTyped())
                {
                    result = result.Concat(a(helper, tc));
                }
            }

            return(result);
        }
Example #7
0
        private static ViewDataDictionary GetViewData(HtmlHelper helper, EntityBase line, TypeContext tc)
        {
            ViewDataDictionary vdd = new ViewDataDictionary(tc);

            if (line.PreserveViewData)
            {
                vdd.AddRange(helper.ViewData);
            }

            return(vdd);
        }
 public static MvcHtmlString EntityTabRepeater<T, S>(this HtmlHelper helper, TypeContext<T> tc, Expression<Func<T, MList<S>>> property)
     where S : Modifiable
 {
     return helper.EntityTabRepeater(tc, property, null);
 }
Example #9
0
 public static MvcHtmlString HiddenLine <T, S>(this HtmlHelper helper, TypeContext <T> tc, Expression <Func <T, S> > property)
 {
     return(helper.HiddenLine(tc, property, null));
 }