这必须是一个非常基本的问题,但在互联网上磕磕绊绊了一段时间后,我无法理解下面的代码.我对c#很新.究竟是什么[](方括号)的用例
class Options
{
[Option('f', "file", Required = true,
HelpText = "Input file to be processed.")]
public string InputFile { get; set; }
[Option('o', "outprefix", Required = true,
HelpText = "Output prefix for file.")]
public string OutPreFix { get; set; }
[Option('v', "verbose", DefaultValue = false,
HelpText = "Prints all messages to standard output.")]
public bool Verbose { get; set; }
[ParserState]
public IParserState LastParserState { get; set; }
[HelpOption]
public string GetUsage()
{
return HelpText.AutoBuild(this, (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2265 次 |
| 最近记录: |