コード例 #1
0
ファイル: DIUtil.cs プロジェクト: williamsrz/MonkeyArms
 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"));
 }
コード例 #2
0
ファイル: DIUtil.cs プロジェクト: arsalan/MonkeyArms
 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"));
 }
コード例 #3
0
ファイル: DIUtil.cs プロジェクト: williamsrz/MonkeyArms
 public static void InjectProps(IInjectingTarget target, InjectionMap map = null)
 {
     Inject (target.GetType ().GetProperties (), target, map);
     Inject (target.GetType ().GetFields (), target, map);
 }
コード例 #4
0
 public static void InjectProps(IInjectingTarget target)
 {
     Inject (target.GetType ().GetProperties (), target);
     Inject (target.GetType ().GetFields (), target);
 }
コード例 #5
0
ファイル: DIUtil.cs プロジェクト: arsalan/MonkeyArms
 public static void InjectProps(IInjectingTarget target)
 {
     Inject(target.GetType().GetProperties(), target);
     Inject(target.GetType().GetFields(), target);
 }
コード例 #6
0
 public static void InjectProps(IInjectingTarget target, InjectionMap map = null)
 {
     Inject(target.GetType().GetProperties(), target, map);
     Inject(target.GetType().GetFields(), target, map);
 }