Пример #1
0
        private void MigrateToAddRhymeEtc()
        {
            var filepath = DistributionChart.GetFileForProject(_projectPathPrefix);
            var error    = TransformFile(filepath, "SIL.Pa.Model.Migration.AddRhymeToDistribution.xslt");

            if (error != null)
            {
                throw error;
            }
        }
Пример #2
0
        /// ------------------------------------------------------------------------------------
        protected override void InternalMigration()
        {
            var filepath = FeatureOverrides.GetFileForProject(_projectPathPrefix);

            if (File.Exists(filepath))
            {
                MigrateFeatureOverrides(filepath);
            }

            filepath = SearchQueryGroupList.GetFileForProject(_projectPathPrefix);
            if (File.Exists(filepath))
            {
                MigrateSearchQueries(filepath);
            }

            filepath = DistributionChart.GetFileForProject(_projectPathPrefix);
            if (File.Exists(filepath))
            {
                MigrateDistributionCharts(filepath);
            }

            if (File.Exists(App.GetPathToRecentlyUsedSearchQueriesFile()))
            {
                MigrateRecentlyUsedSearchQueries(App.GetPathToRecentlyUsedSearchQueriesFile());
            }

            filepath = SearchClassList.GetFileForProject(_projectPathPrefix);
            if (File.Exists(filepath))
            {
                MigrateSearchClasses(filepath);
            }

            if (File.Exists(_projectFilePath))
            {
                MigrateProjectFile();
                UpdateProjectFileToLatestVersion();
            }

            s_performPostProjectLoadMigration = true;

            var msg = LocalizationManager.GetString("ProjectMessages.Migrating.VerifyUpdatedFeatureOverridesMsg",
                                                    "Important Note: Some features in Phonology Assistant have changed and this has implications " +
                                                    "for the feature overrides, search queries and classes for the '{0}' project. These have " +
                                                    "been updated accordingly. However, you may want to verify the accuracy of the results, " +
                                                    "especially if you have overridden some features for this project. To check the feature overrides, " +
                                                    "from the Tools menu, go to 'Descriptive Features' (formerly called articulatory features) and " +
                                                    "'Distinctive Features' (formerly called binary features) and verify the accuracy of overridden " +
                                                    "features. Overridden phones and features will be highlighted in yellow.");

            Utils.MsgBox(string.Format(msg, ProjectName));
        }
Пример #3
0
        /// ------------------------------------------------------------------------------------
        private void MigrateXYChartFile()
        {
            var filename    = DistributionChart.GetFileForProject(_projectPathPrefix);
            var oldFileName = _projectPathPrefix + "XYCharts.xml";

            if (!File.Exists(oldFileName))
            {
                return;
            }

            try
            {
                File.Copy(oldFileName, filename);
                File.Delete(oldFileName);
            }
            catch { return; }
        }
Пример #4
0
        /// ------------------------------------------------------------------------------------
        protected override bool Verify()
        {
            string text = txtName.Text.Trim();

            if (string.IsNullOrEmpty(text))
            {
                Utils.MsgBox(LocalizationManager.GetString(
                                 "DialogBoxes.SaveDistributionChartDlg.NoSavedChartNameMsg",
                                 "You must specify a name for your distribution chart."));

                txtName.SelectAll();
                txtName.Focus();
                return(false);
            }

            var existingLayout = GetExistingLayoutByName(m_xyGrid.ChartLayout, text);

            if (existingLayout != null)
            {
                var msg = LocalizationManager.GetString(
                    "DialogBoxes.SaveDistributionChartDlg.OverwriteSavedChartNameMsg",
                    "There is already a saved chart with the name '{0}'.\nDo you want it overwritten?");

                msg = string.Format(msg, text);

                if (Utils.MsgBox(msg, MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    m_layoutToOverwrite = existingLayout;
                }
                else
                {
                    txtName.SelectAll();
                    txtName.Focus();
                    return(false);
                }
            }

            m_xyGrid.ChartLayout.Name = text;
            return(true);
        }
Пример #5
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Searches the collection of saved chart layouts and returns the one whose name
 /// is that of the one specified. If the layout cannot be found, null is returned.
 /// </summary>
 /// <param name="chartToSkip">Chart Layout to skip as the collection of saved
 /// layouts is searched for the one having the specified name.</param>
 /// <param name="nameToCheck">The name of the saved layout to search for.</param>
 /// ------------------------------------------------------------------------------------
 private DistributionChart GetExistingLayoutByName(DistributionChart chartToSkip, string nameToCheck)
 {
     return(m_savedCharts != null ?
            m_savedCharts.FirstOrDefault(savedChart => savedChart != chartToSkip && savedChart.Name == nameToCheck) :
            null);
 }