Ejemplo n.º 1
0
        //TODO: make this class internal (update all references in mobileezy)!!!

        public DelegateMemberAccessor(string memberName, bool readOnly = false, IObjectCache <string> memberCache = null)
            : base(
                RuntimeDelegateFactory.RetrieveMemberGetValueDelegate <TObjectType, TMemberType>(memberName, memberCache),
                readOnly ? null : RuntimeDelegateFactory.RetrieveMemberSetValueDelegate <TObjectType, TMemberType>(memberName, memberCache),
                true)
        {
            MemberName = memberName;
        }
Ejemplo n.º 2
0
        private static void InitPropertyAccessors()
        {
            var members = GetOrderedMembers();

            s_getters = new Func <T, object> [members.Length];
            s_setters = new Action <T, object> [members.Length];
            s_nameIdx = new Dictionary <string, int>();

            for (int i = 0; i < members.Length; i++)
            {
                s_getters[i] = RuntimeDelegateFactory.RetrieveMemberGetValueDelegate <T, object>(members[i].Name, EmptyObjectCache <string> .Instance);
                s_setters[i] = RuntimeDelegateFactory.RetrieveMemberSetValueDelegate <T, object>(members[i].Name, EmptyObjectCache <string> .Instance);
                s_nameIdx.Add(members[i].Name, i);
            }
        }