public KnowYourTurfHtmlConventions()
        {
            numbers();
            Editors.Builder <SelectFromEnumerationBuilder>();
            Editors.Builder <SelectFromIEnumerableBuilder>();
            Editors.Builder <GroupSelectedBuilder>();
            Editors.Builder <RadioButtonListBuilder>();
            Editors.Builder <TextAreaBuilder>();
            Editors.Builder <DatePickerBuilder>();
            Editors.Builder <TimePickerBuilder>();
            Editors.IfPropertyIs <bool>().BuildBy(TagActionExpression.BuildCheckbox);
            Editors.If(x => x.Accessor.Name.ToLowerInvariant().Contains("password")).BuildBy(r => new PasswordTag().Attr("value", r.RawValue));

            Editors.Always.BuildBy(TagActionExpression.BuildTextbox);
            Editors.Always.Modify(AddElementName);
            Displays.Builder <ImageBuilder>();
            Displays.Builder <EmailDisplayBuilder>();
            Displays.Builder <ListDisplayBuilder>();
            Displays.Builder <DateTimeDisplayBuilder>();
            Displays.Builder <ImageFileDisplayBuilder>();
            Displays.If(x => x.Accessor.PropertyType == typeof(DateTime) || x.Accessor.PropertyType == typeof(DateTime?))
            .BuildBy(req => req.RawValue != null ? new HtmlTag("span").Text(DateTime.Parse(req.RawValue.ToString()).ToLongDateString()) : new HtmlTag("span"));
            Displays.Always.BuildBy(req => new HtmlTag("span").Text(req.StringValue()));
            Labels.Always.BuildBy(req => new HtmlTag("label").Attr("for", req.Accessor.Name).Text(req.Accessor.FieldName.ToSeperateWordsFromPascalCase()));
            validationAttributes();
        }
예제 #2
0
 public virtual void DisplaysChain()
 {
     Displays.Builder <ImageBuilderKO>();
     Displays.Builder <EmailDisplayBuilderKO>();
     Displays.Builder <ListDisplayBuilder>();
     Displays.Builder <DateDisplayBuilderKO>();
     Displays.Builder <TimeDisplayBuilderKO>();
     Displays.Builder <ImageFileDisplayBuilder>();
     Displays.Always.BuildBy(req => new HtmlTag("span").Attr("data-bind", "text:" + DeriveElementName(req)));
 }
예제 #3
0
 public virtual void DisplaysChain()
 {
     Displays.Builder <ImageBuilder>();
     Displays.Builder <EmailDisplayBuilder>();
     Displays.Builder <ListDisplayBuilder>();
     Displays.Builder <ImageFileDisplayBuilder>();
     Displays.Builder <DateFormatter>();
     Displays.Builder <TimeFormatter>();
     Displays.If(x => x.Accessor.PropertyType == typeof(DateTime) || x.Accessor.PropertyType == typeof(DateTime?))
     .BuildBy(req => req.RawValue != null
                 ? new HtmlTag("span").Text(DateTime.Parse(req.RawValue.ToString()).ToLongDateString())
                 : new HtmlTag("span"));
     Displays.Always.BuildBy(req => new HtmlTag("span").Text(req.StringValue()));
 }
예제 #4
0
 public CustomHtmlConventions()
 {
     Displays.Builder <EnumRadioButtonListDisplay>();
     Editors.Builder <EnumRadioButtonListEditor>();
 }