0

I have some event handler delegates in my project, and I want to include them into my auto-generated document with docfx.

I know there is a filter option in docfx.json > metadata, but how could I config it? Any ideas?

I have try to add a filterConfig.yml, and modify the docfx.json, no any error, but this doesn't work.

C# code:

/// <summary>
/// Double click on one row of the search result, this should open the detail form of it
/// </summary>
/// <param name="sender">Default_GridView</param>
/// <param name="e">EventArgs</param>
private void Default_GridView_DoubleClick(object sender, EventArgs e)
{
    //open the detail form here
}

docfx.json:

{
  "metadata": [
    {
      "src": [
        {
          "files": [
            "*.csproj"
          ],
          "cwd": ".",
          "exclude": [
            "**/obj/**",
            "**/bin/**",
            "_site/**"
          ]
        }
      ],
      "dest": "obj/api",
      "filter": "filterConfig.yml"
    }
  ],

filterConfig.yml:

apiRules:
- include:
    uidRegex: ^System\.EventHandler
    type: Type

1 Answers1

1

You will have to make your event handler method public, protected or protected internal. It is generally not possible to include private methods in your API documentation, which makes sense because private methods are not part of your API.

Once you did that, you can remove that API filter. It will just work.

bitbonk
  • 48,890
  • 37
  • 186
  • 278
  • Yes, it works! Thank you sir. And I found another way to do this, I can create a 'public' or ... method, just call the method in delegate with no other content in it, and comment the method, then I have it in my API document. Just a workaround, and thank you again~ – Albert Chang Apr 12 '19 at 06:01