System.Configuration.ClientSettingsStore.GetConfigSection C# (CSharp) Метод

GetConfigSection() приватный Метод

private GetConfigSection ( Configuration config, string sectionName, bool declare ) : ClientSettingsSection
config Configuration
sectionName string
declare bool
Результат ClientSettingsSection
        private ClientSettingsSection GetConfigSection(Configuration config, string sectionName, bool declare) {
            string fullSectionName = UserSettingsGroupPrefix + sectionName;
            ClientSettingsSection section = null;

            if (config != null) {
                section = config.GetSection(fullSectionName) as ClientSettingsSection;

                if (section == null && declare) {
                    // Looks like the section isn't declared - let's declare it and try again.
                    DeclareSection(config, sectionName);
                    section = config.GetSection(fullSectionName) as ClientSettingsSection;
                }
            }

            return section;
        }