Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 286913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:40:45+00:00 2026-05-12T05:40:45+00:00

I want to create a custom configuration section to handle email notifications. The configuration

  • 0

I want to create a custom configuration section to handle email notifications. The configuration needs to be in the following format:

<configSections>
    <sectionGroup name="notifications">
        <section name="notification" type="NotificationConfiguration" allowLocation="true" allowDefinition="Everywhere" />
    </sectionGroup>
</configSections>
...
<notifications>
    <notification name="..." enabled="..." delayInMinutes="...">
        <recipients>
            <add email="..." />
            <add email="..." />
            <add email="..." />
        </recipients>
    </notification>
    <notification name="..." enabled="..." delayInMinutes="...">
        <recipients>
            <add email="..." />
            <add email="..." />
            <add email="..." />
        </recipients>
    </notification>
</notifications>
...

I can get this to work fine using NotificationConfiguration config = (NotificationConfiguration) ConfigurationManager.GetSection("notifications\notification"), but this only caters for one <notification> element. How do I accomplish multiple elements to accommodate more than one notification?

The class that handles this is quite lengthy, so I won’t paste it here, but it can be downloaded from here:

http://files.getdropbox.com/u/288235/NotificationConfiguration.cs

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:40:45+00:00Added an answer on May 12, 2026 at 5:40 am

    You can use the ConfigurationElementCollection Class.

    A reference of how to use it can be found on CodeProject.

    EDIT: You can create a <NotificationsGroup /> outer element, and then put all your notification elements inside that group. This way, you’ll be able to achieve what you want to achieve.

    EDIT 2:

    <configSections>
        <sectionGroup name="NotificationsGroup">
            <section name="NotificationsGroup" type="NotificationGroupConfiguration" allowLocation="true" allowDefinition="Everywhere" />
        </sectionGroup>
    </configSections>
    
    <NotificationsGroup>
        <Notifications>
        </Notifications>
        ... Multiple notifications go here, instead of one.
        <Notifications>
        </Notifications>
    </NotificationsGroup>
    

    This means that NotificationsGroup will contain the element collection of Notifications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want XML in the following format: <configuration><!-- Only one configuration node --> <logging>...</logging><!--
I want to create a custom control in C#. But every time I have
I want to create a custom MSBuild task that changes my .cs files before
I want to create a custom set that will automatically convert objects into a
I want to create a custom property on one of my entities mapped from
I want to create a custom list in Flex for an interface prototype. The
I want to create a custom alert view within my iOS application. For example,
If you want to create a custom attribute for MS test (say [Repeat(3)] how
Background : I want to create a custom VB compiler, extending the original compiler,
In C# if I want to create a Custom Event you do something like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.