Description
Identify, correct confusion of enumeration types and properties that return them
One of the patterns that we've noticed in the enumeration documentation is a confusion of the enumeration type and the member that returns that enumeration type. For example:
If the DayOfWeek property is set to
DayOfWeek.Sunday
, then...
should instead be something like:
If the DateTime.DayOfWeek or DateTimeOffset.DayOfWeek property is set to
DayOfWeek.Sunday
...
It would be nice to identify and correct these. They can be found using a literal string search and a regular expression:
-
In each .xml file in the dotnet/dotnet-api-docs repo, look for the string
<BaseTypeName>System.Enum</BaseTypeName>
, which identifies an enumeration type. -
In each file for an enumeration type, use a regular expression to identify this pattern. The enumeration type's DocId would be one capturing group (
<TypeSignature Language="DocId" Value="T:
fully-qualified-type-name" />
), while a second would be the fully qualified type name. -
That first capturing group would be matched later in the file by a regex pattern like
\k<docid>.+?\<F:\k<fullname>\.\w+\>
.