I know, StyleCop
is not perfect, but we try to use it in a helpful way. I do like the fact that it complains about undocumented arguments. Now, for properties and constructors it recommends what the text should be, but it does not help with Dispose
method, and I think it should. We have many classes that implement IDisposable
. In this particular case the class is a WinForm
. The trouble is that I have not been able to come up with great documentation for the Dispose
method, and I have not seen a good example online either. Many examples have no comment whatsoever. I am hoping that someone who feels like Dispose
method is a second nature to them, can help me document this once and for all, so that I can re-use this comment everywhere.
Here is what we have:
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (this.components != null)
{
this.components.Dispose();
}
}
base.Dispose(disposing);
}
And here is the warning message:
Warning 15 SA1611: The documentation header must contain param tags matching the element's parameter list.
I hope that other So users will find the answer to this helpful as well. Let me know if you have questions.