コード例 #1
0
ファイル: FormHelper.cs プロジェクト: Epitomy/CMS
 public static void RegisterFormGenerator(string formType, ISchemaForm schemaForm)
 {
     lock (forms)
     {
         forms[formType] = schemaForm;
     }
 }
コード例 #2
0
ファイル: FormHelper.cs プロジェクト: nguyenhuy2911/CMS
 public static void RegisterFormGenerator(string formType, ISchemaForm schemaForm)
 {
     lock (forms)
     {
         forms[formType] = schemaForm;
     }
 }
コード例 #3
0
ファイル: FormHelper.cs プロジェクト: nguyenhuy2911/CMS
        public static string Generate(this ISchema schema, string formType)
        {
            var rendered = false;

            string html = ProcessRazorView(schema, formType, out rendered);

            if (!rendered)
            {
                ISchemaForm schemaForm = forms[formType];
                html = schemaForm.Generate(schema);
            }

            return(html);
        }
コード例 #4
0
ファイル: FormHelper.cs プロジェクト: Epitomy/CMS
        public static string Generate(this ISchema schema, string formType)
        {
            string html = string.Empty;
            //string templateFile = Path.Combine(TemplateDir, formType + ".tt");
            //if (Kooboo.Web.TrustLevelUtility.CurrentTrustLevel == AspNetHostingPermissionLevel.Unrestricted && System.IO.File.Exists(templateFile))
            //{
            //    string templateContent = IO.IOUtility.ReadAsString(templateFile);
            //    html = ProcessT4(templateContent, schema);
            //}
            //else
            //{
            ISchemaForm schemaForm = forms[formType];

            html = schemaForm.Generate(schema);
            //}

            return(html);
        }