Как задокументировать параметры типа в методе или свойстве с типом возврата универсального Action или Func - PullRequest
0 голосов
/ 13 марта 2012

У меня очень простой вопрос, как бы вы документировали с помощью xmldoc метод или свойство с типом возврата универсального Action или Func.Например:

/// <summary>
/// Gets or sets the print method. Parameters: file, printer name???
/// </summary> 
/// <value>
/// The print method.
/// </value>
public Action<string, string> PrintMethod { get; set; }

Какова наилучшая практика в этом случае?

1 Ответ

0 голосов
/ 13 марта 2012

Если вам необходимо задокументировать параметры этого действия, не используйте Action<string, string>: вместо этого создайте пользовательский делегат и задокументируйте параметры делегата.

/// <summary>
/// Gets or sets the print method.
/// </summary> 
/// <value>
/// The print method.
/// </value>
public FilePrintAction PrintMethod { get; set; }

/// <summary>
/// Represents a method for printing a file to a printer
/// </summary> 
/// <parameter name="file">Path of the file to print</parameter>
/// <parameter name="printerName">Name of the printer</parameter>
public delegate void FilePrintAction(string file, string printerName);
...