internal static void OnMethodGenerateDocComment (
MethodCore mc, XmlElement el, Report Report)
{
var paramTags = new Dictionary<string, string> ();
foreach (XmlElement pelem in el.SelectNodes ("param")) {
string xname = pelem.GetAttribute ("name");
if (xname.Length == 0)
continue; // really? but MS looks doing so
if (xname != "" && mc.ParameterInfo.GetParameterIndexByName (xname) < 0)
Report.Warning (1572, 2, mc.Location, "XML comment on `{0}' has a param tag for `{1}', but there is no parameter by that name",
mc.GetSignatureForError (), xname);
else if (paramTags.ContainsKey (xname))
Report.Warning (1571, 2, mc.Location, "XML comment on `{0}' has a duplicate param tag for `{1}'",
mc.GetSignatureForError (), xname);
paramTags [xname] = xname;
}
IParameterData [] plist = mc.ParameterInfo.FixedParameters;
foreach (Parameter p in plist) {
if (paramTags.Count > 0 && !paramTags.ContainsKey (p.Name))
Report.Warning (1573, 4, mc.Location, "Parameter `{0}' has no matching param tag in the XML comment for `{1}'",
p.Name, mc.GetSignatureForError ());
}
}