internal void UnloadRecursive (Boolean dispose)
{
#if MONO_TRACE
TraceContext trace = (Context != null && Context.Trace.IsEnabled) ? Context.Trace : null;
string type_name = null;
if (trace != null) {
type_name = GetType ().Name;
trace.Write ("control", String.Concat ("UnloadRecursive ", _userId, " ", type_name));
}
#endif
int ccount = _controls != null ? _controls.Count : 0;
for (int i = 0; i < ccount; i++) {
Control c = _controls [i];
c.UnloadRecursive (dispose);
}
#if MONO_TRACE
if (trace != null)
trace.Write ("control", String.Concat ("End UnloadRecursive ", _userId, " ", type_name));
#endif
ControlAdapter tmp = Adapter;
if (tmp != null)
tmp.OnUnload (EventArgs.Empty);
else
OnUnload (EventArgs.Empty);
if (dispose)
Dispose ();
}