Exemplo n.º 1
0
 public override bool Equals(object obj)
 {
     if (obj != null && obj is FilterableAttribute)
     {
         FilterableAttribute fa = (FilterableAttribute)obj;
         return(this.filterable == fa.filterable);
     }
     return(false);
 }
        public static bool IsPropertyFilterable(PropertyDescriptor propertyDescriptor)
        {
            FilterableAttribute attribute = (FilterableAttribute)propertyDescriptor.Attributes[typeof(FilterableAttribute)];

            if (attribute != null)
            {
                return(attribute.Filterable);
            }
            return(true);
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            FilterableAttribute attribute = obj as FilterableAttribute;

            return((attribute != null) && (attribute.Filterable == this._filterable));
        }
Exemplo n.º 4
0
        /// <internalonly/>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            FilterableAttribute other = obj as FilterableAttribute;

            return((other != null) && (other.Filterable == _filterable));
        }
        public static bool IsTypeFilterable(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }
            object obj2 = _filterableTypes[type];

            if (obj2 == null)
            {
                FilterableAttribute attribute = (FilterableAttribute)TypeDescriptor.GetAttributes(type)[typeof(FilterableAttribute)];
                obj2 = (attribute == null) ? ((object)0) : ((object)attribute.Filterable);
                _filterableTypes[type] = obj2;
            }
            return((bool)obj2);
        }
Exemplo n.º 6
0
        public static bool IsTypeFilterable(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            object result = _filterableTypes[type];

            if (result != null)
            {
                return((bool)result);
            }

            System.ComponentModel.AttributeCollection attrs = TypeDescriptor.GetAttributes(type);
            FilterableAttribute attr = (FilterableAttribute)attrs[typeof(FilterableAttribute)];

            result = (attr != null) && attr.Filterable;
            _filterableTypes[type] = result;

            return((bool)result);
        }