protected override void OnDestroyed() { if (vAdjustment != null) { vAdjustment.Destroy(); hAdjustment.Destroy(); foreach (var adj in attachedVAdjustments) { adj.Destroy(); } foreach (var adj in attachedHAdjustments) { adj.Destroy(); } vAdjustment = null; } foreach (var hscrollbar in hScrollBars) { Remove(hscrollbar); hscrollbar.Destroy(); } foreach (var child in children.ToArray()) { child.Child.Destroy(); } base.OnDestroyed(); }
protected override void OnDestroyed() { if (Child != null) { Child.Destroy(); } if (vAdjustment != null) { vAdjustment.Changed -= HandleAdjustmentChanged; vAdjustment.Destroy(); vAdjustment = null; } if (hAdjustment != null) { hAdjustment.Changed -= HandleAdjustmentChanged; hAdjustment.Destroy(); hAdjustment = null; } if (vScrollBar != null) { vScrollBar.Destroy(); vScrollBar = null; } if (hScrollBar != null) { hScrollBar.Destroy(); hScrollBar = null; } foreach (var c in children) { c.Child.Destroy(); } base.OnDestroyed(); }
protected override void OnDestroyed() { base.OnDestroyed(); if (vAdjustment != null) { vAdjustment.Destroy(); hAdjustment.Destroy(); foreach (var adj in attachedVAdjustments) { adj.Destroy(); } foreach (var adj in attachedHAdjustments) { adj.Destroy(); } vAdjustment = null; } children.ForEach(child => child.Child.Destroy()); }