/// <summary> /// Initializes a new instance of <see cref="DefaultViewComponentActivator"/> class. /// </summary> public DefaultViewComponentActivator() { _valueAccessorLookup = CreateValueAccessorLookup(); _injectActions = new ConcurrentDictionary <Type, PropertyActivator <ViewContext>[]>(); _getPropertiesToActivate = type => PropertyActivator <ViewContext> .GetPropertiesToActivate( type, typeof(ActivateAttribute), CreateActivateInfo); }
private PropertyActivator <ActionContext>[] GetPropertiesToActivate(Type type) { var activators = PropertyActivator <ActionContext> .GetPropertiesToActivate( type, typeof(ViewDataDictionaryAttribute), p => new PropertyActivator <ActionContext>(p, GetViewDataDictionary)); return(activators); }
private PropertyActivator <ActionContext>[] GetPropertiesToActivate(Type type) { var activatorsForActivateProperties = PropertyActivator <ActionContext> .GetPropertiesToActivate( type, typeof(ActivateAttribute), CreateActivateInfo); return(activatorsForActivateProperties); }
private PropertyActivator <Contexts>[] GetPropertiesToActivate(Type type) { IEnumerable <PropertyActivator <Contexts> > activators; activators = PropertyActivator <Contexts> .GetPropertiesToActivate( type, typeof(ActionContextAttribute), p => new PropertyActivator <Contexts>(p, c => c.ActionContext)); activators = activators.Concat(PropertyActivator <Contexts> .GetPropertiesToActivate( type, typeof(ActionBindingContextAttribute), p => new PropertyActivator <Contexts>(p, c => c.ActionBindingContext))); return(activators.ToArray()); }
private PropertyActivator <ActionContext>[] GetPropertiesToActivate(Type type) { IEnumerable <PropertyActivator <ActionContext> > activators; activators = PropertyActivator <ActionContext> .GetPropertiesToActivate( type, typeof(ActionContextAttribute), p => new PropertyActivator <ActionContext>(p, c => c)); activators = activators.Concat(PropertyActivator <ActionContext> .GetPropertiesToActivate( type, typeof(ActionBindingContextAttribute), p => new PropertyActivator <ActionContext>(p, GetActionBindingContext))); activators = activators.Concat(PropertyActivator <ActionContext> .GetPropertiesToActivate( type, typeof(ViewDataDictionaryAttribute), p => new PropertyActivator <ActionContext>(p, GetViewDataDictionary))); return(activators.ToArray()); }