예제 #1
0
        /// <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);
        }
예제 #2
0
 public static Dictionary <MemberInfo, IGetterSetter> GetOrCreateAccessors <T>()
 {
     return(AccessorMgr.GetOrCreateAccessors(typeof(T)));
 }