Exemple #1
0
 public void AddToButtons(IHtmlContent content = null, string function = null, string url = null, BtnClass btn = BtnClass.Default, string icon = null, string identifier = null, string classes = null, string title = null, object attr = null)
 {
     if (url != null)
     {
         url = RazorUtils.ApplyConvension(url, AppParts.Route);
     }
     Buttons.Add(LinkModel.Make(content, function, url, btn, icon, identifier, classes, title, attr));
 }
        public virtual IHtmlContent Button(IHtmlHelper helper, string text, string function, string url, BtnClass btn, string icon, string identifier, IHtmlContent content, string classes, string title, object attr)
        {
            content = content != null ? content : (text == null ? null : helper.Word(text));
            if (url != null)
            {
                url = RazorUtils.ApplyConvension(url, AppParts.Route);
            }
            LinkModel model = LinkModel.Make(content, function, url, btn, icon, identifier, classes, title, attr);

            return(helper.GetComponent("Buttons/Button", model));
        }
        public CellWriter LinkCell <T, TValue>(IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp, string url, bool blank, object cellAttributes, object linkAttributes, string pipe)
        {
            var writer = new CellWriter(helper);

            writer.UseExpression(exp);
            writer.Initialize(null, null, cellAttributes, null);
            if (url != null)
            {
                url = RazorUtils.ApplyConvension(url, AppParts.Route);
            }
            writer.InputModel = writer.InputModel.GetLabelInput(pipe, url, blank);
            pipe = pipe == null ? "" : " | " + pipe;
            if (pipe.Contains("translate"))
            {
                writer.InputModel.NgModelName = "'Words.'+" + writer.InputModel.NgModelName;
            }

            writer.InputModel.MemberName += pipe;
            return(writer);
        }