Does anyone know where Control.ShouldSerializeVisible is called from? The Reflector does not show it used by anything and google came up empty.
Does anyone know where Control.ShouldSerializeVisible is called from? The Reflector does not show it
Share
The private ShouldSerializeXxx() methods are an alternative for the [DefaultValue] attribute. That attribute cannot always be used since the default value may depend on state that can’t be expressed in the DefaultValueAttribute constructor or requires a complex expression.
The method is executed through Reflection, it is exposed through the PropertyDescriptor.ShouldSerializeValue() method. Important clients of this plumbing are the PropertyGrid control (uses it to select a bold font) and the Windows Forms design-time code serializer (uses it to suppress unnecessary code).