vb.net – 是否有“特殊”方法通过XML注释识别IntelliSense中方法参数的默认值?

vb.net – 是否有“特殊”方法通过XML注释识别IntelliSense中方法参数的默认值?,第1张

概述通常,我有一系列重载方法,所有方法都汇集到一个“主”方法中.每个重载接受不同的参数组合,然后将这些值传递给“master”以及一些未包含在重载版本中的任何“默认”值.我正在尝试为这些方法创建 XML文档,我想以一些明显的方式指出这些默认值是什么. 是否有一个特定的XML标记可以被这种形式的文档用于识别将传递给另一个方法的默认值?理想情况下,我希望在IntelliSense中看到类似Default的 通常,我有一系列重载方法,所有方法都汇集到一个“主”方法中.每个重载接受不同的参数组合,然后将这些值传递给“master”以及一些未包含在重载版本中的任何“默认”值.我正在尝试为这些方法创建 XML文档,我想以一些明显的方式指出这些默认值是什么.

是否有一个特定的XML标记可以被这种形式的文档用于识别将传递给另一个方法的默认值?理想情况下,我希望在IntelliSense中看到类似Default的内容:< parametername>值< defaultvalue>,尽管在XML文档功能的标准行为中可能要求一点点.

如果没有“特殊”XML标签用于类似的东西,我想我只需要在< summary>中提出一些适当的措辞.或<备注>部分. “这将使用< defaultvalue>的默认值为< parametername> …”的效果.我只是认为如果有办法识别这些默认值以及其他参数会更好看.

显然,这不是一个关键需求.我只是好奇这一点,想知道我是否只是忽略了一些东西.以下是相关代码的示例.我已经删除了主方法中的实际 *** 作代码,因为它与此问题无关,但如果有人需要/想要它,我会指出它.

“大师”方法

''' <summary>''' Merges multiple pdf files into a single pdf file''' </summary>''' <param name="pdffiles">A List of specific pdf files to merge</param>''' <param name="Outputfilename">The pdf file to create from the merged pdf files</param>''' <param name="OverwriteExistingpdf">If the specifIEd pdf file already exists,IDentifIEs whether or not to overwrite the existing file</param>''' <param name="SortOrder">IDentifIEs the order in which to add the source pdf files to the output file</param>''' <returns>A fileInfo object representing the merged pdf if successful. <cref>nothing</cref> if unsuccessful.</returns>''' <remarks>Using the <see cref="iTextSharp.text.pdf.pdfcopy"/> (<paramref name="UseSmartMerge"/> = <c>False</c>) may result in larger files,''' while using the <see cref="iTextSharp.text.pdf.pdfSmartcopy"/> (<paramref name="UseSmartMerge"/> = <c>True</c>) may result in longer processing times.</remarks>Public Overloads Function Merge(ByVal pdffiles As List(Of System.IO.fileInfo),ByVal UseSmartMerge As Boolean,ByVal Outputfilename As String,ByVal OverwriteExistingpdf As Boolean,ByVal SortOrder As pdfMergeSortOrder) As System.IO.fileInfo    Dim Resultfile As System.IO.fileInfo = nothing    ...<merge the files>...    Return ResultfileEnd Function

重载方法

''' <summary>''' Merges multiple pdf files into a single pdf file''' </summary>''' <param name="pdffiles">A List of specific pdf files to merge</param>''' <param name="Outputfilename">The pdf file to create from the merged pdf files</param>''' <param name="OverwriteExistingpdf">If the specifIEd pdf file already exists,IDentifIEs whether or not to overwrite the existing file</param>''' <returns>A fileInfo object representing the merged pdf if successful. <cref>nothing</cref> if unsuccessful.</returns>Public Overloads Function Merge(ByVal pdffiles As List(Of System.IO.fileInfo),ByVal OverwriteExistingpdf As Boolean) As System.IO.fileInfo    Return Merge(pdffiles,False,Outputfilename,pdfMergeSortOrder.Original)End Function''' <summary>''' Merges multiple pdf files into a single pdf file''' </summary>''' <param name="pdffiles">A List of specific pdf files to merge</param>''' <param name="UseSmartMerge">IDentifIEs whether to use a regular <see cref="iTextSharp.text.pdf.pdfcopy"/> or the <see cref="iTextSharp.text.pdf.pdfSmartcopy"/> for merging</param>''' <param name="Outputfilename">The pdf file to create from the merged pdf files</param>''' <param name="OverwriteExistingpdf">If the specifIEd pdf file already exists,IDentifIEs whether or not to overwrite the existing file</param>''' <returns>A fileInfo object representing the merged pdf if successful. <cref>nothing</cref> if unsuccessful.</returns>''' <remarks>Using the <see cref="iTextSharp.text.pdf.pdfcopy"/> (<paramref name="UseSmartMerge"/> = <c>False</c>) may result in larger files,UseSmartMerge,pdfMergeSortOrder.Original)End Function''' <summary>''' Merges multiple pdf files into a single pdf file''' </summary>''' <param name="pdffiles">A List of specific pdf files to merge</param>''' <param name="Outputfilename">The pdf file to create from the merged pdf files</param>''' <param name="SortOrder">IDentifIEs the order in which to add the source pdf files to the output file</param>''' <returns>A fileInfo object representing the merged pdf if successful. <cref>nothing</cref> if unsuccessful.</returns>Public Overloads Function Merge(ByVal pdffiles As List(Of System.IO.fileInfo),ByVal SortOrder As pdfMergeSortOrder) As System.IO.fileInfo    Return Merge(pdffiles,SortOrder)End Function''' <summary>''' Merges multiple pdf files into a single pdf file''' </summary>''' <param name="pdffiles">A List of specific pdf files to merge</param>''' <param name="UseSmartMerge">IDentifIEs whether to use a regular <see cref="iTextSharp.text.pdf.pdfcopy"/> or the <see cref="iTextSharp.text.pdf.pdfSmartcopy"/> for merging</param>''' <param name="Outputfilename">The pdf file to create from the merged pdf files</param>''' <param name="SortOrder">IDentifIEs the order in which to add the source pdf files to the output file</param>''' <returns>A fileInfo object representing the merged pdf if successful. <cref>nothing</cref> if unsuccessful.</returns>''' <remarks>Using the <see cref="iTextSharp.text.pdf.pdfcopy"/> (<paramref name="UseSmartMerge"/> = <c>False</c>) may result in larger files,SortOrder)End Function#End Region
解决方法 无论何时涉及到房产,它都是不费吹灰之力的.我的建议是将 value标签扩展为以下内容:

''' <summary>Returns the number of times Counter was called.</summary>''' <value>Default: 0</value>''' <returns><see cref="Integer"/> value based on the number of times Counter was called.</returns>Public Property Counter As Integer

然而,当谈到方法时(这是你最初提出的问题),那么我会选择你的直觉并将其包含在remarks标签或returns中.

总结

以上是内存溢出为你收集整理的vb.net – 是否有“特殊”方法通过XML注释识别IntelliSense中方法参数的默认值?全部内容,希望文章能够帮你解决vb.net – 是否有“特殊”方法通过XML注释识别IntelliSense中方法参数的默认值?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1250637.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-07
下一篇 2022-06-07

发表评论

登录后才能评论

评论列表(0条)

保存