UIControl.7.Dispose.cs 917 B

123456789101112131415161718192021222324252627282930313233343536
  1. 
  2. namespace Microsoft.Windows.Forms
  3. {
  4. partial class UIControl
  5. {
  6. /// <summary>
  7. /// 释放资源
  8. /// </summary>
  9. /// <param name="disposing">释放托管资源为 true,否则为 false</param>
  10. protected override void Dispose(bool disposing)
  11. {
  12. IUIControl parent = this.UIParent;
  13. this.UIParent = null;
  14. if (parent != null)
  15. parent.DoLayout();
  16. if (this.m_UIControls != null)
  17. {
  18. this.m_UIControls.Dispose();
  19. this.m_UIControls = null;
  20. }
  21. if (this.m_Region != null)
  22. {
  23. this.m_Region.Dispose();
  24. this.m_Region = null;
  25. }
  26. if (this.m_Sprite != null)
  27. {
  28. this.m_Sprite.Dispose();
  29. this.m_Sprite = null;
  30. }
  31. }
  32. }
  33. }