/// <summary> /// Copies all public properties that have a setter and a getter and exist in the types of both objects from input to output. /// Ignores all properties that have the <see cref="T:WCell.Util.DynamicAccess.DontCopyAttribute" />. /// </summary> /// <returns></returns> public static IGetterSetter GetOrCreateAccessor(Type type, PropertyInfo info) { IGetterSetter getterSetter; if (!AccessorMgr.GetOrCreateAccessors(type).TryGetValue((MemberInfo)info, out getterSetter)) { throw new Exception("Tried to get accessor for invalid Property: " + (object)info); } return(getterSetter); }
public static Dictionary <MemberInfo, IGetterSetter> GetOrCreateAccessors <T>() { return(AccessorMgr.GetOrCreateAccessors(typeof(T))); }