/// <summary>
 /// Checks whether given <see cref="AbstractInjectableModel"/> is non-<c>null</c> and the injectable value will be dependant on fragment instance.
 /// </summary>
 /// <param name="model">The <see cref="AbstractInjectableModel"/>.</param>
 /// <returns><c>true</c> if <paramref name="model"/> is non-<c>null</c> and the injection scope attribute has <see cref="FragmentDependentInjectionAttribute"/> applied to it; <c>false</c> otherwise.</returns>
 public static Boolean IsFragmentDependant(this AbstractInjectableModel model)
 {
     return(model != null && model.InjectionScope != null && model.GetAttributesOfAttribute(model.InjectionScope.GetType()).ContainsKey(typeof(FragmentDependentInjectionAttribute)));
 }
示例#2
0
 private static IEnumerable <Tuple <Attribute, ServiceQualifierAttribute> > GetQualifierTypes(AbstractInjectableModel model)
 {
     return(model.GetAttributesMarkedWith(typeof(ServiceQualifierAttribute))
            .Select(attr => Tuple.Create(attr, (ServiceQualifierAttribute)model.GetAttributesOfAttribute(attr.GetType())[typeof(ServiceQualifierAttribute)][0])));
 }