public void RegisterRequiresControlState (Control control)
{
if (control == null)
throw new ArgumentNullException ("control");
if (RequiresControlState (control))
return;
if (requireStateControls == null)
requireStateControls = new List <Control> ();
requireStateControls.Add (control);
int n = requireStateControls.Count - 1;
if (_savedControlState == null || n >= _savedControlState.Length)
return;
for (Control parent = control.Parent; parent != null; parent = parent.Parent)
if (parent.IsChildControlStateCleared)
return;
object state = _savedControlState [n];
if (state != null)
control.LoadControlState (state);
}