コード例 #1
0
 /// <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);
 }
コード例 #2
0
        private PropertyActivator <ActionContext>[] GetPropertiesToActivate(Type type)
        {
            var activators = PropertyActivator <ActionContext> .GetPropertiesToActivate(
                type,
                typeof(ViewDataDictionaryAttribute),
                p => new PropertyActivator <ActionContext>(p, GetViewDataDictionary));

            return(activators);
        }
コード例 #3
0
        private PropertyActivator <ActionContext>[] GetPropertiesToActivate(Type type)
        {
            var activatorsForActivateProperties = PropertyActivator <ActionContext> .GetPropertiesToActivate(
                type,
                typeof(ActivateAttribute),
                CreateActivateInfo);

            return(activatorsForActivateProperties);
        }
コード例 #4
0
        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());
        }
コード例 #5
0
        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());
        }