ApplicationSettingsGroup

  • Thread starter Thread starter Bill McCormick
  • Start date Start date
B

Bill McCormick

How do you use ApplicationSettingsGroup?

do this:

SettingsGroups = new ApplicationSettingsGroup();

doesn't seem to really be of much use.

What is the correct way to iterate through section groups?

Thanks,

Bill
 
Good morning Bill

First of all, sorry for the big delay of our response. The delay is caused
by an issue in the MSDN managed newsgroup system, and we are working with
relevant teams to fix it. In future, if you see the delay again, please
directly send an email to (e-mail address removed). We will take action in no
time.

For this thread about ApplicationSettingsGroup, you can use the following
code to iterate through section groups:

Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// You can use config.SectionGroups to interate the section groups

ApplicationSettingsGroup appSettingsGroup =
config.GetSectionGroup("applicationSettings") as
ApplicationSettingsGroup;
if (appSettingsGroup != null)
{
for (int i = 0; i < appSettingsGroup.Sections.Count; i++)
{
ConfigurationSection section = appSettingsGroup.Sections;
}
}

If you have any questions or concerns, please feel free to tell me.

Our apology for the delayed response again.

Regards,
Jialiang Ge
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
Good morning Bill

First of all, sorry for the big delay of our response. The delay is caused
by an issue in the MSDN managed newsgroup system, and we are working with
relevant teams to fix it. In future, if you see the delay again, please
directly send an email to (e-mail address removed). We will take action in no
time.

For this thread about ApplicationSettingsGroup, you can use the following
code to iterate through section groups:

Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// You can use config.SectionGroups to interate the section groups

ApplicationSettingsGroup appSettingsGroup =
config.GetSectionGroup("applicationSettings") as
ApplicationSettingsGroup;
if (appSettingsGroup != null)
{
for (int i = 0; i < appSettingsGroup.Sections.Count; i++)
{
ConfigurationSection section = appSettingsGroup.Sections;
}
}

If you have any questions or concerns, please feel free to tell me.


OK. That's what I ended up doing. But what I was looking for was an iterator
that I could use foreach with. After I dug deeper, I found that the
ConfigurationSection class doesn't descend from the necessary class for this.

Thanks,

Bill
 
Back
Top