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")); }
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")); }
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); }
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); }