Exemple #1
0
        private void SetDefaultSettings()
        {
            var loggerSection   = _configuration.Sections[LoggerSection] as LoggerSection;
            var projectsSection = _configuration.Sections[ProjectsSection] as ProjectsSection;

            if (loggerSection == null)
            {
                loggerSection = new LoggerSection();
                _configuration.Sections.Add(LoggerSection, loggerSection);

                loggerSection.FileElement.Name = loggerSection.FileElement.Name;
            }
            if (projectsSection == null)
            {
                projectsSection = new ProjectsSection();
                _configuration.Sections.Add(ProjectsSection, projectsSection);

                projectsSection.DefaultFolder.Path = projectsSection.DefaultFolder.Path;
            }

            _configuration.Save(ConfigurationSaveMode.Modified);
        }
        private void SetDefaultSettings()
        {
            var loggerSection = _configuration.Sections[LoggerSection] as LoggerSection;
            var projectsSection = _configuration.Sections[ProjectsSection] as ProjectsSection;

            if (loggerSection == null)
            {
                loggerSection = new LoggerSection();
                _configuration.Sections.Add(LoggerSection, loggerSection);

                loggerSection.FileElement.Name = loggerSection.FileElement.Name;
            }
            if (projectsSection == null)
            {
                projectsSection = new ProjectsSection();
                _configuration.Sections.Add(ProjectsSection, projectsSection);

                projectsSection.DefaultFolder.Path = projectsSection.DefaultFolder.Path;
            }

            _configuration.Save(ConfigurationSaveMode.Modified);
        }