通常,我有一系列重载方法,所有方法都汇集到一个“主”方法中.每个重载接受不同的参数组合,然后将这些值传递给“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 ResultFile 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="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
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。