public static void RegisterFormGenerator(string formType, ISchemaForm schemaForm) { lock (forms) { forms[formType] = schemaForm; } }
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); }
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); }