protected override void OnClosing(CancelEventArgs e) { //get everything saved (under the old collection name, if we are changing the name and restarting) _libraryClosingEvent.Raise(null); //change the collection name now, when it's safe try { if (!string.IsNullOrEmpty(_nameToChangeCollectionUponClosing) && _nameToChangeCollectionUponClosing != _collectionSettings.CollectionName) { _collectionSettings.AttemptSaveAsToNewName(_nameToChangeCollectionUponClosing); } } catch (Exception error) { Palaso.Reporting.ErrorReport.NotifyUserOfProblem(error, "Sorry, Bloom could not rename the project to '{0}'", _nameToChangeCollectionUponClosing); } Settings.Default.MruProjects.AddNewPath(_collectionSettings.SettingsFilePath); base.OnClosing(e); }