/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { // Release all the plugins. CadKit.Plugins.Manager.Instance.release(this); lock (_mutex) { if (disposing && (components != null)) { components.Dispose(); components = null; } base.Dispose(disposing); _deserializeDockContent = null; _persistantForms = null; _windowForms = null; _windowMenu = null; _menuStrip = null; _statusStrip = null; _toolStrip = null; _dockPanel = null; if (null != _recentFiles) { _recentFiles.dereference(); _recentFiles = null; } } }
/// <summary> /// Constructor. /// </summary> public MainForm(string persistentName) { _recentFiles.reference(); _deserializeDockContent = new WeifenLuo.WinFormsUI.DeserializeDockContent(this._getContentFromPersistString); this.PersistentName = persistentName; this.InitializeComponent(); this.IsMdiContainer = true; if (CadKit.Persistence.Registry.Instance.getBool("CadKit.Options.General", "use_system_mdi_child_windows", true)) { _dockPanel.DocumentStyle = WeifenLuo.WinFormsUI.DocumentStyles.SystemMdi; } else if (CadKit.Persistence.Registry.Instance.getBool("CadKit.Options.General", "use_tabbed_mdi_child_windows", true)) { _dockPanel.DocumentStyle = WeifenLuo.WinFormsUI.DocumentStyles.DockingMdi; // DockingSdi or DockingWindow makes it assert in CadKit.Referenced.Base on exit. } this.Text = CadKit.Helios.Application.Instance.Name; this._buildMenu(); this._buildToolBar(); this.Load += this._formLoad; this.FormClosing += this._formClosing; this.FormClosed += this._formClosed; this.AllowDrop = true; this.DragEnter += this._dragEnter; this.DragDrop += this._dragDrop; }