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); }
internal KeyedRoleMap(KeyedRoleMap parent) { this._parent = (KeyedRoleMap)parent; this._rolemap = new Dictionary <Type, IDictionary <Object, Object> >(); }
internal void Clear(KeyedRoleMap newParent) { this._parent = newParent; this._rolemap.Clear(); }