Bloom.Edit.EditingView.OnShowBookMetadataEditor C# (CSharp) Method

OnShowBookMetadataEditor() private method

private OnShowBookMetadataEditor ( ) : void
return void
        private void OnShowBookMetadataEditor()
        {
            try
            {
                if(!_model.CanEditCopyrightAndLicense)
                {
                    MessageBox.Show(LocalizationManager.GetString("EditTab.CannotChangeCopyright",
                        "Sorry, the copyright and license for this book cannot be changed."));
                    return;
                }

                _model.SaveNow();
                //in case we were in this dialog already and made changes, which haven't found their way out to the Book yet

                var metadata = _model.CurrentBook.GetLicenseMetadata();

                Logger.WriteEvent("Showing Metadata Editor Dialog");
                using(var dlg = new SIL.Windows.Forms.ClearShare.WinFormsUI.MetadataEditorDialog(metadata))
                {
                    dlg.ShowCreator = false;
                    if(DialogResult.OK == dlg.ShowDialog())
                    {
                        Logger.WriteEvent("For BL-3166 Investigation");
                        if(metadata.License == null)
                        {
                            Logger.WriteEvent("old LicenseUrl was null ");
                        }
                        else
                        {
                            Logger.WriteEvent("old LicenseUrl was " + metadata.License.Url);
                        }
                        if(dlg.Metadata.License == null)
                        {
                            Logger.WriteEvent("new LicenseUrl was null ");
                        }
                        else
                        {
                            Logger.WriteEvent("new LicenseUrl: " + dlg.Metadata.License.Url);
                        }

                        _model.ChangeBookLicenseMetaData(dlg.Metadata);
                    }
                }
                Logger.WriteMinorEvent("Emerged from Metadata Editor Dialog");
            }
            catch(Exception error)
            {
                // Throwing this exception is causing it to be swallowed.  It results in the web browser just showing a blank white page, but no
                // message is displayed and no exception is caught by the debugger.
                //#if DEBUG
                //				throw;
                //#endif
                SIL.Reporting.ErrorReport.NotifyUserOfProblem(error,
                    "There was a problem recording your changes to the copyright and license.");
            }
        }