Esempio n. 1
0
 private void AppendEditor(IHtmlNode container, HtmlHelper <TModel> htmlHelper)
 {
     if (TemplateName.HasValue())
     {
         AppendEditorTemplate(htmlHelper, container);
     }
     else
     {
         AppendEditorFor(htmlHelper, container);
     }
 }
Esempio n. 2
0
 private void AppendValidator(IHtmlNode container, HtmlHelper <TModel> htmlHelper)
 {
     if (TemplateName.HasValue() && (typeof(TModel).IsDataRow() || typeof(TModel).IsDynamicObject()))
     {
         AppendValidatorForTemplate(htmlHelper, container);
     }
     else
     {
         AppendValidatorFor(htmlHelper, container);
     }
 }
Esempio n. 3
0
        public void InitializeEditor(ViewContext viewContext, ViewDataDictionary viewData)
        {
            if (Enabled && TemplateName.HasValue())
            {
                var popupSlashes = new Regex("(?<=data-val-regex-pattern=\")([^\"]*)", RegexOptions.Multiline);
                var helper       = new HtmlHelper <T>(viewContext, new SchedulerViewDataContainer <T>(DefaultDataItem(), viewData));


                EditorHtml = helper.EditorForModel(TemplateName).ToHtmlString();
                //}
                //else
                //{
                //    EditorHtml = helper.EditorForModel().ToHtmlString();
                //}

                EditorHtml = popupSlashes.Replace(EditorHtml, match =>
                {
                    return(match.Groups[0].Value.Replace("\\", "\\\\"));
                });
            }
        }