我正在编写一个 C# 类库,其中包含许多具有相同功能的类。我需要为每个类中的函数参数提供 XML 注释,这些注释非常详细,但在大多数情况下是相同的。有没有办法重用 XML 注释,这样我就不必在整个程序集中重复这些 XML 参数定义?
这是我的课程的一个例子:
public class IsodoseControl : TestModule
{
/// <summary>
/// Verify a control on Isodose dialog
/// </summary>
/// <param name="args"> **<-- WHAT I DON'T WANT TO KEEP REPEATING**
/// Arguments: [Property, Condition, Expected Value, Tolerance]
/// Properties: STATE, VALUE, LABEL
/// Conditions: Exists, DoesNotExist, IsEnabled, IsDisabled, ...
/// Expected Value (optional): blah blah
/// Tolerance (optional): blah blah blah
/// </param>
public VerifResult VerifyIsodoseControl(string[] args)
{
...
}
}
public class BeamControl : TestModule
{
/// <summary>
/// Verify a control on Beam dialog
/// </summary>
/// <param name="args"> **<-- WHAT I DON'T WANT TO KEEP REPEATING**
/// Arguments: [Property, Condition, Expected Value, Tolerance]
/// Properties: STATE, VALUE, LABEL
/// Conditions: Exists, DoesNotExist, IsEnabled, IsDisabled, ...
/// Expected Value (optional): blah blah
/// Tolerance (optional): blah blah blah
/// </param>
public VerifResult VerifyBeamControl(string[] args)
{
...
}
}
谢谢