private void m_btnQuoteMarkSettings_Click(object sender, EventArgs e)
        {
            var reparseOkay = false;

            if (m_model.Project.IsLiveParatextProject)
            {
                reparseOkay = m_model.Project.QuoteSystemStatus != QuoteSystemStatus.Obtained;
            }
            else if (!m_model.Project.IsSampleProject)
            {
                if (m_model.Project.IsOkayToChangeQuoteSystem)
                {
                    reparseOkay = true;
                }
                else
                {
                    string msg = string.Format(LocalizationManager.GetString("Project.UnableToLocateTextBundleMsg",
                                                                             "The original text release bundle for the project is no longer in its original location ({0}). " +
                                                                             "The Quote Mark Settings cannot be modified without access to it."), m_model.Project.OriginalBundlePath) +
                                 Environment.NewLine + Environment.NewLine +
                                 LocalizationManager.GetString("Project.LocateBundleYourself", "Would you like to locate the text release bundle yourself?");
                    string title = LocalizationManager.GetString("Project.UnableToLocateTextBundle", "Unable to Locate Text Bundle", "Message caption");
                    if (DialogResult.Yes == MessageBox.Show(msg, title, MessageBoxButtons.YesNo))
                    {
                        reparseOkay = SelectBundleForProjectDlg.GiveUserChanceToFindOriginalBundle(m_model.Project);
                    }
                }
            }

            BlockNavigatorViewModel viewModel = null;

            try
            {
                if (m_model.Project.IncludedBooks.Any())
                {
                    viewModel = new BlockNavigatorViewModel(m_model.Project, BlocksToDisplay.AllExpectedQuotes, m_model);
                }
                using (var dlg = new QuotationMarksDlg(m_model.Project, viewModel, !reparseOkay, this))
                {
                    MainForm.LogDialogDisplay(dlg);
                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        UpdateQuotePageDisplay();
                    }
                }
            }
            finally
            {
                viewModel?.Dispose();
            }
        }
Ejemplo n.º 2
0
        private void m_btnQuoteMarkSettings_Click(object sender, EventArgs e)
        {
            bool reparseOkay = false;

            if (m_model.Project.IsSampleProject)
            {
                string msg   = LocalizationManager.GetString("Project.CannotChangeSampleMsg", "The Quote Mark Settings cannot be modified for the Sample project.");
                string title = LocalizationManager.GetString("Project.CannotChangeSample", "Cannot Change Sample Project");
                MessageBox.Show(msg, title);
            }
            else
            {
                if (!m_model.Project.IsReparseOkay())
                {
                    string msg = string.Format(LocalizationManager.GetString("Project.UnableToLocateTextBundleMsg",
                                                                             "The original text bundle for the project is no longer in its original location ({0}). " +
                                                                             "The Quote Mark Settings cannot be modified without access to the original text bundle."), m_model.Project.OriginalBundlePath) +
                                 Environment.NewLine + Environment.NewLine +
                                 LocalizationManager.GetString("Project.LocateBundleYourself", "Would you like to locate the text bundle yourself?");
                    string title = LocalizationManager.GetString("Project.UnableToLocateTextBundle", "Unable to Locate Text Bundle");
                    if (DialogResult.Yes == MessageBox.Show(msg, title, MessageBoxButtons.YesNo))
                    {
                        reparseOkay = SelectProjectDlg.GiveUserChanceToFindOriginalBundle(m_model.Project);
                    }
                }
                else
                {
                    reparseOkay = true;
                }
            }

            using (var viewModel = new BlockNavigatorViewModel(m_model.Project, BlocksToDisplay.AllExpectedQuotes, m_model))
                using (var dlg = new QuotationMarksDlg(m_model.Project, viewModel, !reparseOkay))
                {
                    MainForm.LogDialogDisplay(dlg);
                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        UpdateQuotePageDisplay();
                    }
                }
        }