private static bool SendProviderInfo(HttpContext context) { HttpResponse response = context.Response; JsonProviders providers = SingletonHelper.GetSessionSingleton <JsonProviders>(); string providerInfoJson = JsonSerializer.ToJson(providers.ProviderInfos); string providerInfoScript = @"JSUI.providerInfo = " + providerInfoJson + ";\r\n"; providerInfoScript += "JSUI.providerInfo = JSUI.toDictionary(\"VarName\", JSUI.providerInfo);"; response.Clear(); response.Write(providerInfoScript); response.Flush(); response.SuppressContent = true; return(true); }
internal static void SetProvider(object handlerInstance, Page page) { Type serverHandler = handlerInstance.GetType(); if (serverHandler == typeof(RuntimeTypeHandle)) { return; } JsonProviders providers = SingletonHelper.GetSessionSingleton <JsonProviders>();//if (javascriptHandlers == null) JsonProviderInfo provider = providers.Add(handlerInstance); if (page != null) { RegisterClientInitScript(page, provider); } }
internal static object GetInstance(string typeName) { JsonProviders providers = SingletonHelper.GetSessionSingleton <JsonProviders>();//if (javascriptHandlers == null) return(providers[typeName]); }