예제 #1
0
        /// <summary>
        /// Displays the settings for the local settings file.
        /// </summary>
        internal void LocalProjectSettings()
        {
            // Get the active project.
            Project project = ProjectUtilities.GetActiveProject();

            // Get the path to the local settings file for this project.
            string localSettingsFileFolder = ProjectUtilities.GetProjectPath(project);

            if (localSettingsFileFolder == null)
            {
                AlertDialog.Show(
                    this.core,
                    null,
                    Strings.CantGetProjectPath,
                    Strings.Title,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
            else
            {
                // Show the local settings dialog.
                string settingsFilePath = Path.Combine(localSettingsFileFolder, Settings.DefaultFileName);
                if (!File.Exists(settingsFilePath))
                {
                    string deprecatedSettingsFile = Path.Combine(localSettingsFileFolder, Settings.AlternateFileName);
                    if (File.Exists(deprecatedSettingsFile))
                    {
                        settingsFilePath = deprecatedSettingsFile;
                    }
                    else
                    {
                        deprecatedSettingsFile = Path.Combine(localSettingsFileFolder, V101Settings.DefaultFileName);
                        if (File.Exists(deprecatedSettingsFile))
                        {
                            settingsFilePath = deprecatedSettingsFile;
                        }
                    }
                }

                this.core.AddSettingsPages += this.StyleCopCoreAddSettingsPages;
                this.core.ShowSettings(settingsFilePath);
                this.core.AddSettingsPages -= this.StyleCopCoreAddSettingsPages;
            }
        }