public void InitializeTranslator() { translator = new JavaScriptExpressionTranslator(); CreateDateParseLocale(); CreateDateLocaleFormat(); CreateNumberLocaleFormat(); }
static ExoWeb() { // Create the javascript translator ExpressionTranslator = new JavaScriptExpressionTranslator(); // Cache the .NET 4.0 method info to create HTML strings when using MVC Assembly assembly = null; try { assembly = Assembly.Load("System.Web.Mvc"); } catch (Exception e) { // If unable to load MVC properly, keep going. } if (assembly != null) { var type = assembly.GetType("System.Web.Mvc.MvcHtmlString"); if (type != null) { createHtmlString = type.GetMethod("Create", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(string) }, null); } } // Initialize the default implementation of the cache hash provider CacheHashProvider = () => { if (cacheHash == null) { int code = 0; foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) { code = code == 0 ? a.GetHashCode() : code ^ a.GetHashCode(); } cacheHash = code.ToString(); } return(cacheHash); }; // Enable server rendering by default EnableServerRendering = true; }
public void Cleanup() { translator = null; }