protected void Application_Start() { NameValueCollection wfpars = new NameValueCollection(); wfpars.Add("operation", "registerservicestack"); OptimaJet.Workflow.Designer.DesignerAPI(null, wfpars); //OptimaJet.Workflow.Core.Runtime.WorkflowRuntime.RegisterLicense("<Your license key for WorkflowEngine.NET>"); BundleConfig.RegisterBundles(BundleTable.Bundles); AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); Logger.InitLogger(); System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en"); OptimaJet.Security.Providers.SecurityCache.Provider = new BudgetSecurityProvider(); ConfigureDynamicEntities(); //Сериализация дат изменена JsConfig <DateTime> .SerializeFn = SerializeDateFn; RazorTemplates.CompileAllFormTemplates(); CheckMetadata(); //OptimaJet.DynamicEntities.ExternalMethods.ExternalMethodCompiller.DebugMode = true; //OptimaJet.Workflow.Core.CodeActions.CodeActionsCompiller.DebugMode = true; //DWKitHelper.ExternalMethodCompileAll(); }
/// <summary>Generates code for the Single Value Object.</summary> /// <param name="dir"> /// The directory to write the files to. /// </param> /// <param name="input"> /// The input data of the Single Value Object. /// </param> public void Generate(DirectoryInfo dir, SvoStruct input) { var fileStruct = new FileInfo(Path.Combine(dir.FullName, input.ClassName + ".cs")); var fileJavaScript = new FileInfo(Path.Combine(dir.FullName, "Qowaiv." + input.ClassName + ".js")); var fileTypeConverter = new FileInfo(Path.Combine(dir.FullName, input.ClassName + "TypeConverter.cs")); var fileUnitTest = new FileInfo(Path.Combine(dir.FullName, input.ClassName + "Test.cs")); var templateStruct = RazorTemplates.Select <SvoStruct>(); var templateJavaScript = RazorTemplates.Select <SvoStruct>("_JavaScript"); var templateTypeConverter = RazorTemplates.Select <SvoStruct>("_TypeConverter"); var templateUnitTest = RazorTemplates.Select <SvoStruct>("_UnitTest"); templateStruct.GenerateFile(input, fileStruct); templateJavaScript.GenerateFile(input, fileJavaScript); templateTypeConverter.GenerateFile(input, fileTypeConverter); templateUnitTest.GenerateFile(input, fileUnitTest); }
public void BasicRazorTemplate() { string folder = PathUtility.GetDeployPath(); var razor = new RazorTemplates(); razor.StartRazorHost("C:\\projects2010\\DocumentationMonster\\SampleProject"); var topic = new DocTopic(null) { Title = "New Topic", Body = "Getting to the **point** of it all" }; string error; string output = razor.RenderTemplate("~/topic.cshtml", topic, out error); if (error != null) { Console.WriteLine(error); } Assert.NotNull(output); Console.WriteLine(output); }