I am using Visual Studio for a couple of years now and we have always just written all the XML comments for our C# code manually.
But lately I recognize the need for a way to centrally maintain certain XML comments as they are repeated multiple times throughout our code.
For example we will have several methods that accept the same parameter as they call each other in sequence, passing down the variable.
Or we will use the same parameter (like a search date for version handling) on multiple completely separate locations.
/// <summary>
/// Get data by searchdate
/// </summary>
/// <param name="searchdate">The date to use while fetching the data</param>
public void MethodX(DateTime searchDate)
// fetch something from somewhere by date
var y = MethodY(searchDate);
}
/// <summary>
/// Get some more data by searchdate
/// </summary>
/// <param name="searchdate">The date to use while fetching the data</param>
public void MethodY(DateTime searchDate)
// fetch something more from somewhere else by date
}
We cannot store them in a resource file, as you cannot use code inside XML tags (at least I think I can't).
Is there an efficient way of storing and maintaining these repeated parts in our XML comments?