protected void Dispose(bool disposing) { if (disposing) { // free managed resources if (FileLoadWorker != null) { FileLoadWorker.Dispose(); FileLoadWorker = null; } if (this.ViewController != null) { this.ViewController.Dispose(); this.ViewController = null; } } }
public void OpenFile(string path) { if (this.FileLoadWorker != null) { FileLoadWorker.Dispose(); } var worker = new FileLoadWorker(path, this); worker.ExceptionThrown += this.HandleFileLoadError; worker.Ended += this.HandleFileLoadEnd; worker.Starting += this.HandleFileLoadStart; worker.Start(); this.FileLoadWorker = worker; }