protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { EventAggregationManager.RemoveListener(this); } }
private void RibbonFormWorkspace_FormClosed(object sender, FormClosedEventArgs e) { EventAggregationManager.RemoveListener(this); EventAggregationManager.RemoveListener(this._mainController); foreach (var controller in this._controllers) { EventAggregationManager.RemoveListener(controller.Value); controller.Value.Dispose(); } }
protected override void Dispose(bool disposing) { this.UnRegisterEventHandlers(); ODataListSource source = this.bindingSource1.DataSource as ODataListSource; if (source != null) { source.Clear(); source.Dispose(); source = null; } if (this._comingDataSource != null) { this._comingDataSource.Clear(); this._comingDataSource.Dispose(); this._comingDataSource = null; } this.bindingSource1.DataSource = null; if (source != null) { source.Clear(); source.Dispose(); } if (disposing) { EventAggregationManager.RemoveListener(this); if (components != null) { components.Dispose(); } } if (this.gridControl1 != null) { this.gridControl1.DataSource = null; this.gridView1 = null; this.gridControl1.Dispose(); } if (disposing && (components != null)) { components.Dispose(); } if (this.DoubleClickCommand != null) { this.DoubleClickCommand = null; } base.Dispose(disposing); GC.Collect(); }
protected override void Dispose(bool disposing) { if (disposing) { EventAggregationManager.RemoveListener(this); if (_mainController != null) { _mainController.Dispose(); _mainController = null; } ActionResult = null; ActiveView = null; if (_controllers != null) { _controllers.Clear(); _controllers = null; } if (_views != null) { _views.Clear(); _views = null; } if (components != null) { components.Dispose(); } BindingContext = null; if (this._commandManager != null) { this._commandManager.Dispose(); this._commandManager = null; } if (this._workspaceContext != null) { this._workspaceContext.Dispose(); this._workspaceContext = null; } } base.Dispose(disposing); LoggingService.InfoFormatted(" Start SuppressFinalize WorkSpace {0}:{1}", this.ObjectName, DateTime.Now.ToString("HH:mm:ss fff")); GC.Collect(); GC.SuppressFinalize(this); LoggingService.InfoFormatted(" End SuppressFinalize WorkSpace {0}:{1}", this.ObjectName, DateTime.Now.ToString("HH:mm:ss fff")); }