Beispiel #1
0
 public override void MemberInfo(object obj,InjectProperty[] InjectPropertys)
 {
     if(InjectPropertys != null && InjectPropertys.Count() > 0)
     {
         foreach(var property in InjectPropertys)
         {
             PropertyInfo propertyInfo = obj.GetType().GetProperty(property.Name,BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.CreateInstance);
             if(propertyInfo != null && propertyInfo.CanWrite)
             {
                 object tempobj = null;
                 if(property.Value == null)
                 {
                     if(property.Source != null)
                         tempobj = Container.Resolve(property.Target,property.Source);
                     else if(property.Target != null)
                         tempobj = Container.Resolve(property.Target);
                     else
                         tempobj = Container.Resolve(propertyInfo.PropertyType);
                 }
                 else
                 {
                     tempobj = property.Value;
                 }
                 propertyInfo.SetValue(obj,tempobj,null);
             }
         }
     }
 }
Beispiel #2
0
 public BindingTarget(Type type,InjectProperty[] property,InjectMethod[] method)
 {
     this.type = type;
     this.property = property;
     this.method = method;
 }
Beispiel #3
0
 public virtual void MemberInfo(object obj,InjectProperty[] InjectPropertys)
 {
 }