我正在尝试利用 Visual Studio 中的 XML 表示法功能来为我正在编写的 API 构建文档。我遇到了一个问题,我无法弄清楚如何在我的代码示例中引用方法名称而不自动填充参数类型
例子:
/// <summary>
/// Exports the certificate corresponding to the specified certificate thumbprint to a Base64-encoded text file
/// </summary>
/// <param name="certThumbprint">Certificate thumbprint (case-insensitive)</param>
/// <param name="exportPath">Fully-qualified path to where the Base64-encoded file should be written (a ".cer" file extension will be added if no file extension is detected)</param>
/// <param name="certStore">(Optional) The certificate store where the encryption certificate resides (Default: <see cref="CertStore"/>.<see cref="CertStore.CurrentUser"/>)</param>
/// <param name="verbose">True enables verbose logging</param>
/// <returns>The fully-qualified path to where the Base64-encoded certificate file was ultimately written</returns>
/// <example>
/// <code>
/// string thumbprint = @"ccdc673c40ebb2a433300c0c8a2ba6f443da5688";
/// string exportPath = @"C:\data\cert";
/// <see cref="CertStore"/> certStore = <see cref="CertStore"/>.<see cref="CertStore.CurrentUser"/>;
/// string finalExportPath = <see cref="X509Utils"/>.ExportCert(thumbprint, exportPath, certStore);
/// //finalExportPath is @"C:\data\cert.cer"
/// </code>
/// </example>
这使用 DocX 获得了以下结果:
为什么我不能在不自动显示参数类型的情况下引用方法名称?我是否需要对示例中的方法调用使用字符串文字而不是引用它?