Esempio n. 1
0
        public void SetupInit(HttpApplication application)
        {
            //Wrap all binders
            var binders = ModelBinders.Binders;
            var keys = binders.Keys.ToList();

            for (int i = 0; i < keys.Count; i++)
            {
                var type = keys[i];

                if (!(binders[type] is GlimpseModelBinder))
                    binders[type] = new GlimpseModelBinder(binders[type]);
            }
            if (!(ModelBinders.Binders.DefaultBinder is GlimpseDefaultModelBinder))
                ModelBinders.Binders.DefaultBinder = new GlimpseDefaultModelBinder();

            //Wrap all providers/provider factories
            var factories = ValueProviderFactories.Factories;

            for (int i = 0; i < factories.Count; i++)
            {
                if (!(factories[i] is GlimpseValueProviderFactory))
                    factories[i] = new GlimpseValueProviderFactory(factories[i]);
            }
        }
Esempio n. 2
0
        public static void ValueProviders()
        {
            //TODO: Need to proxy value providers?
            var factories = ValueProviderFactories.Factories;

            for (int i = 0; i < factories.Count; i++)
            {
                if (!(factories[i] is GlimpseValueProviderFactory))
                {
                    factories[i] = new GlimpseValueProviderFactory(factories[i]);
                }
            }
        }