private bool LoadPeptideSearchLibrary(LibrarySpec docLibSpec) { if (docLibSpec == null) { return(false); } using (var longWait = new LongWaitDlg { Text = Resources.BuildPeptideSearchLibraryControl_LoadPeptideSearchLibrary_Loading_Library }) { try { var status = longWait.PerformWork(WizardForm, 800, monitor => ImportPeptideSearch.LoadPeptideSearchLibrary(LibraryManager, docLibSpec, monitor)); if (status.IsError) { MessageDlg.ShowException(WizardForm, status.ErrorException); } } catch (Exception x) { MessageDlg.ShowWithException(WizardForm, TextUtil.LineSeparate(string.Format(Resources.BuildPeptideSearchLibraryControl_LoadPeptideSearchLibrary_An_error_occurred_attempting_to_import_the__0__library_, docLibSpec.Name), x.Message), x); } } return(ImportPeptideSearch.HasDocLib); }