Beispiel #1
0
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            ulong            field;
            ClrFieldDescData fieldDesc;

            try
            {
                _parent.Proc.FindFieldByNameEx(_mt, binder.Name, out field, out fieldDesc);
                result = _parent.ReadTypedField(_obj, fieldDesc);

                if (result is ulong)
                {
                    result = new ObjectProxy((ulong)result, _parent);
                }

                return(true);
            }
            catch (ArgumentException) // Field not found
            {
                result = null;
                return(false);
            }
        }
Beispiel #2
0
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            ulong field;
            ClrFieldDescData fieldDesc;

            try
            {
                _parent.Proc.FindFieldByNameEx(_mt, binder.Name, out field, out fieldDesc);
                result = _parent.ReadTypedField(_obj, fieldDesc);

                if (result is ulong)
                {
                    result = new ObjectProxy((ulong)result, _parent);
                }

                return true;
            }
            catch (ArgumentException) // Field not found
            {
                result = null;
                return false;
            }
        }