Beispiel #1
0
 private static IEnumerable<object> GetAttributes(IInjectingTarget target, MemberInfo memberInfo)
 {
     if (memberInfo is FieldInfo) {
         return target.GetType ().GetField (memberInfo.Name).GetCustomAttributes (false);
     }
     if (memberInfo is PropertyInfo) {
         return target.GetType ().GetProperty (memberInfo.Name).GetCustomAttributes (false);
     }
     throw (new ArgumentException ("Inject tag was places on a member type injection doesn't support"));
 }
Beispiel #2
0
 private static IEnumerable <object> GetAttributes(IInjectingTarget target, MemberInfo memberInfo)
 {
     if (memberInfo is FieldInfo)
     {
         return(target.GetType().GetField(memberInfo.Name).GetCustomAttributes(false));
     }
     if (memberInfo is PropertyInfo)
     {
         return(target.GetType().GetProperty(memberInfo.Name).GetCustomAttributes(false));
     }
     throw (new ArgumentException("Inject tag was places on a member type injection doesn't support"));
 }
Beispiel #3
0
 public static void InjectProps(IInjectingTarget target, InjectionMap map = null)
 {
     Inject (target.GetType ().GetProperties (), target, map);
     Inject (target.GetType ().GetFields (), target, map);
 }
 public static void InjectProps(IInjectingTarget target)
 {
     Inject (target.GetType ().GetProperties (), target);
     Inject (target.GetType ().GetFields (), target);
 }
Beispiel #5
0
 public static void InjectProps(IInjectingTarget target)
 {
     Inject(target.GetType().GetProperties(), target);
     Inject(target.GetType().GetFields(), target);
 }
 public static void InjectProps(IInjectingTarget target, InjectionMap map = null)
 {
     Inject(target.GetType().GetProperties(), target, map);
     Inject(target.GetType().GetFields(), target, map);
 }