Beispiel #1
0
        public Nancy.ViewEngines.Razor.IHtmlString GetFieldHtml(IReadonlyFieldConfiguration fieldConfiguration)
        {
            fieldConfiguration = fieldConfiguration ?? new ReadonlyFieldConfiguration(new FieldConfiguration());
            if (fieldConfiguration.FieldHtml != null)
            {
                return(fieldConfiguration.FieldHtml);
            }

            return(FieldGeneratorHandlersRouter <TModel, T> .GetFieldHtml(this, fieldConfiguration));
        }
Beispiel #2
0
        public IReadonlyFieldConfiguration PrepareFieldConfiguration(IFieldConfiguration fieldConfiguration)
        {
            fieldConfiguration = fieldConfiguration ?? new FieldConfiguration();
            if (!string.IsNullOrEmpty(Metadata.EditFormatString) && string.IsNullOrEmpty(fieldConfiguration.FormatString))
            {
                fieldConfiguration.WithFormatString(Metadata.EditFormatString);
            }
            if (!string.IsNullOrEmpty(Metadata.NullDisplayText) && string.IsNullOrEmpty(fieldConfiguration.NoneString))
            {
                fieldConfiguration.WithNoneAs(Metadata.NullDisplayText);
            }

            FieldGeneratorHandlersRouter <TModel, T> .PrepareFieldConfiguration(this, fieldConfiguration);

            return(new ReadonlyFieldConfiguration(fieldConfiguration));
        }