System.ComponentModel.PropertyDescriptor.CanResetValue C# (CSharp) Method

CanResetValue() public abstract method

When overridden in a derived class, indicates whether resetting the component will change the value of the component.

public abstract CanResetValue ( object component ) : bool
component object
return bool
        public abstract bool CanResetValue(object component);

Usage Example

Example #1
0
        /// <summary>
        /// Returns whether or not the property can be reset</summary>
        /// <param name="owners">Objects whose property is tested</param>
        /// <param name="descriptor">Property to reset</param>
        /// <returns>True iff the property can be reset on the object</returns>
        public static bool CanResetProperty(IEnumerable <object> owners, PropertyDescriptor descriptor)
        {
            foreach (object owner in owners)
            {
                if (!descriptor.CanResetValue(owner))
                {
                    return(false);
                }
            }

            return(true);
        }
All Usage Examples Of System.ComponentModel.PropertyDescriptor::CanResetValue