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

  • Home
  • SEARCH
  • 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 678381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:08:36+00:00 2026-05-14T01:08:36+00:00

I am visiting some old code, and there are quite a few events declared

  • 0

I am visiting some old code, and there are quite a few events declared with delegates manually rather than using EventHandler<T>, like this:

/// <summary>
/// Delegate for event Added
/// </summary>
/// <param name="index">Index of the item</param>
/// <param name="item">The item itself</param>
public delegate void ItemAdded(int index, T item);

/// <summary>
/// Added is raised whenever an item is added to the collection
/// </summary>
public event ItemAdded Added;

All well and good, until I come to use sandcastle to document the library, because it then can’t find any XML comments for the private Added field that is generated by the event declaration. I want to try and sort that out, but what I would like to do is either:

  • Get sandcastle to ignore the auto-generated private field without telling it to ignore all private fields entirely

or

  • Get XML comments generated for the private field

Is there any way of achieving this without re-factoring the code to look like this:

/// <summary>
/// Delegate for event <see cref="Added"/>
/// </summary>
/// <param name="index">Index of the item</param>
/// <param name="item">The item itself</param>
public delegate void ItemAdded(int index, T item);

/// <summary>
/// Private storage for the event firing delegate for the <see cref="Added"/> event
/// </summary>
private ItemAdded _added;

/// <summary>
/// Added is raised whenever an item is added to the collection
/// </summary>
public event ItemAdded Added
{
    add
    {
        _added += value;
    }
    remove
    {
        _added -= value;
    }
}
  • 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-14T01:08:36+00:00Added an answer on May 14, 2026 at 1:08 am

    Although sub-optimal, I found a way around this, which was to manually put the XML comments into the file that contains namespace-level documentation for the project, along these lines:

    <member name="F:myCompany.Common.Collections.Generic.EventableCollection`1.Added">
      <summary>
        Auto-generated backing field for the <see cref="E:myCompany.Common.Collections.Generic.EventableSortedList`1.Added">Added</see> event
      </summary>
    </member>
    

    This then gives roughly what I needed.

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

Sidebar

Related Questions

I am having some trouble generating a web form using fields specified in an
I had an idea while I was working on some PHP code. Usually, if
I'd like to fire up some script if the user is visiting my site's
I have some code like: header('Refresh: 15; url=' . $url); This works fine, except
I was reading some posts about closures and saw this everywhere, but there is
I'm currently implementing some code that should, for each method of a class, run
I have been visiting some sites hosted on GAE and I found them to
LinkedIn has this cool feature in which while visiting some user's profile, LinkedIn prompts
I am grabbing some data to put in my iOS app by visiting an
We have a problem occuring on some of our developer workstations: when visiting a

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.