private static DocumentedField MapField(IFieldInfo field, XmlDocumentationModel xmlModel)
{
SummaryComment summary = null;
RemarksComment remarks = null;
IEnumerable<ExampleComment> examples = null;
// Get the documentation for the type.
var member = xmlModel.Find(field.Identity);
if (member != null)
{
// Get the comments for the type.
summary = member.Comments.OfType<SummaryComment>().SingleOrDefault();
remarks = member.Comments.OfType<RemarksComment>().SingleOrDefault();
examples = member.Comments.OfType<ExampleComment>();
}
return new DocumentedField(field, summary, remarks, examples, field.Metadata);
}