Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Properly document C# event delegates

I hope I'm using the right terminology.

I want to document a public event Action<> delegate

public event Action<int, int, WriteableBitmap, Exception> OperationDone

For this I want the user to know which generic stands for what. So I was thinking of something like:

    /// <summary>
    /// Event triggers if a thumbnail image has been loaded. If loading a thumbnail was requested and the request has failed, 
    /// the causing exception will be passed as argument (otherwise null).
    /// pdfViewerPage, newViewerPage, bitmap, exception
    /// <param name="pdfViewerPage"/> viewer page of the thumbnail at the time of the request creation
    /// <param name="newViewerPage"/> viewer page of the thumbnail at the time of the request completion
    /// <param name="bitmap"/> Bitmap of the thumbnail
    /// <param name="exception"/> Exception of the request
    /// </summary>

But this gives me warnings since the delegate doesn't define parameters. Is there a way to nicely document this or do I have to stick to just use the summary?

like image 214
Philipp Avatar asked May 08 '26 19:05

Philipp


1 Answers

Try to use typeparam instead:

/// <typeparam name="pdfViewerPage"> viewer page of the thumbnail at the time of the request creation</typeparam>
/// <typeparam name="newViewerPage"> viewer page of the thumbnail at the time of the request completion</typeparam>
/// <typeparam name="bitmap"> Bitmap of the thumbnail</typeparam>
/// <typeparam name="exception"> Exception of the request</typeparam>
like image 120
Roman Marusyk Avatar answered May 10 '26 11:05

Roman Marusyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!