Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        internal static object GetInstance(string typeName)
        {
            JsonProviders providers = SingletonHelper.GetSessionSingleton <JsonProviders>();//if (javascriptHandlers == null)

            return(providers[typeName]);
        }