Exemple #1
0
        public IEnumerable <IMember> Get(TypeInfo parameter)
        {
            var properties = _properties.Get(parameter)
                             .ToArray();
            var length = properties.Length;

            for (var i = 0; i < length; i++)
            {
                var property = properties[i];
                if (_specification.IsSatisfiedBy(property))
                {
                    yield return(_members.Get(property));
                }
            }

            var fields = _fields.Get(parameter)
                         .ToArray();
            var l = fields.Length;

            for (var i = 0; i < l; i++)
            {
                var field = fields[i];
                if (_specification.IsSatisfiedBy(field))
                {
                    yield return(_members.Get(field));
                }
            }
        }
Exemple #2
0
        bool Allowed(MemberInfo reflected)
        {
            switch (reflected)
            {
            case FieldInfo field:
                return(_specification.IsSatisfiedBy(field));

            case PropertyInfo property:
                return(_specification.IsSatisfiedBy(property));

            default:
                return(false);
            }
        }