示例#1
0
        public Object ProvideInjection(CompositeInstance instance, AbstractInjectableModel model, Type targetType)
        {
            KeyedRoleMap roleMap = RoleMapHolder.INVOCATION_DATA.Value.RoleMap;
            Object       result;

            if (roleMap.ThisHasRole(targetType))
            {
                result = roleMap.Get <Object>(targetType);
            }
            else
            {
                FunctionInvocationDataAttribute attr = (FunctionInvocationDataAttribute)model.InjectionScope;
                result = attr.GetFactory(targetType).NewInvocationData();
                roleMap.Set(result);
            }
            return(result);
        }
示例#2
0
 internal KeyedRoleMap(KeyedRoleMap parent)
 {
     this._parent  = (KeyedRoleMap)parent;
     this._rolemap = new Dictionary <Type, IDictionary <Object, Object> >();
 }
示例#3
0
 internal void Clear(KeyedRoleMap newParent)
 {
     this._parent = newParent;
     this._rolemap.Clear();
 }