Skip to content

Latest commit

 

History

History
979 lines (610 loc) · 56.1 KB

api-reference.md

File metadata and controls

979 lines (610 loc) · 56.1 KB

DocXml.dll v3.8.0.0 API documentation

Created by mddox on 11/18/2024

Command line: mddox DocXml.dll -s latest -c -d

All types

ReflectionExtensions Class CommonComments Class DocXmlReader Class
EnumComments Class EnumValueComment Class InheritdocTag Class
MethodComments Class SeeAlsoTag Class TypeComments Class
XmlDocId Class DocXmlReaderExtensions Class ReflectionSettings Class
TypeCollection Class TypeInformation Class

ReflectionExtensions Class

Namespace: DocXml.Reflection

Reflection extension methods with supporting properties.

Properties

Name Type Summary
KnownTypeNames Dictionary<Type, string> A dictionary containing a mapping of type to type names.

Methods

Name Returns Summary
CleanGenericTypeName(string genericTypeName) string Remove the parameter count part of the generic type name.
For example the generic list type name is List`1.
This method leaves only the name part of the type such as List.
If specified string does not contain the number of parameters
part then the same string is returned.
CreateKnownTypeNamesDictionary() Dictionary<Type, string> Create a dictionary of standard value types and a string type.
IsNullable(Type type) bool Checks if the specified type is a nullable value type.
Returns false for object references.
ToNameString(Type type, Func<Type, string> typeNameConverter) string Convert type to the proper type name.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns ValueTuple types without field names.
ToNameString(Type type, Func<Type, Queue, string> typeNameConverter, bool invokeTypeNameConverterForGenericType) string Convert type to the proper type name.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns ValueTuple types without field names.
ToNameString(Type type, Queue tupleFieldNames, Func<Type, Queue, string> typeNameConverter, bool invokeTypeNameConverterForGenericType) string Convert type to the proper type name.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns named tuples with field names like this (Type1 field1, Type2 field2). tupleFieldNames parameter
must be specified with all tuple field names stored in the same order as they are in compiler-generated TupleElementNames attribute.
If you do not know what it is then the better and easier way is to use ToTypeNameString() methods that retrieve field names from attributes.
ToNameStringWithValueTupleNames(Type type, IList tupleNames, Func<Type, Queue, string> typeNameConverter, bool invokeTypeNameConverterForGenericType) string Convert type to the string.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).
ToParametersString(MethodBase methodInfo, Func<Type, Queue, string> typeNameConverter, bool invokeTypeNameConverterForGenericType) string Convert method parameters to the string. If method has no parameters then returned string is ()
If parameters are present then returned string contains parameter names with their type names.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).
ToTypeNameString(ParameterInfo parameterInfo, Func<Type, Queue, string> typeNameConverter, bool invokeTypeNameConverterForGenericType) string Convert method parameter type to the string.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).
ToTypeNameString(MethodInfo methodInfo, Func<Type, Queue, string> typeNameConverter, bool invokeTypeNameConverterForGenericType) string Convert method return value type to the string.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).
ToTypeNameString(PropertyInfo propertyInfo, Func<Type, Queue, string> typeNameConverter, bool invokeTypeNameConverterForGenericType) string Convert property type to the string.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).
ToTypeNameString(FieldInfo fieldInfo, Func<Type, Queue, string> typeNameConverter, bool invokeTypeNameConverterForGenericType) string Convert field type to the string.
Optional typeNameConverter function can convert type names to strings
if type names should be decorated in some way either by converting text to markdown or
HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).

Methods

CleanGenericTypeName(string genericTypeName)

Remove the parameter count part of the generic type name. For example the generic list type name is List`1. This method leaves only the name part of the type such as List. If specified string does not contain the number of parameters part then the same string is returned.

Parameter Type Description
genericTypeName string Type name

Returns

string

Type name without the number of parameters.

CreateKnownTypeNamesDictionary()

Create a dictionary of standard value types and a string type.

Returns

Dictionary<Type, string>

Dictionary mapping types to type names

IsNullable(Type type)

Checks if the specified type is a nullable value type. Returns false for object references.

Parameter Type Description
type Type Type to check.

Returns

bool

True if the type is nullable like int? or Nullable<Something>

ToNameString(Type type, Func<Type, string> typeNameConverter)

Convert type to the proper type name. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns ValueTuple types without field names.

Parameter Type Description
type Type Type information.
typeNameConverter Func<Type, string> The optional function that converts type name to string.

Returns

string

Full type name

ToNameString(Type type, Func<Type, Queue<string>, string> typeNameConverter, bool invokeTypeNameConverterForGenericType)

Convert type to the proper type name. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns ValueTuple types without field names.

Parameter Type Description
type Type Type information.
typeNameConverter Func<Type, Queue, string> The optional function that converts type name to string.
invokeTypeNameConverterForGenericType bool True if typeNameConverter lambda function should be invoked for generic type name such as for the List name in case of List
If the parameter value is false then typeNameConverter is not invoked for the generic type name and only the plain type name is returned.
If the parameter value is true then typeNameConverter must handle generic type definitions carefully and avoid calling
ToNameString() to avoid infinite recursion.

Returns

string

Full type name

ToNameString(Type type, Queue<string> tupleFieldNames, Func<Type, Queue<string>, string> typeNameConverter, bool invokeTypeNameConverterForGenericType)

Convert type to the proper type name. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns named tuples with field names like this (Type1 field1, Type2 field2). tupleFieldNames parameter must be specified with all tuple field names stored in the same order as they are in compiler-generated TupleElementNames attribute. If you do not know what it is then the better and easier way is to use ToTypeNameString() methods that retrieve field names from attributes.

Parameter Type Description
type Type
tupleFieldNames Queue The names of value tuple fields as stored in TupleElementNames attribute. This queue is modified during call.
typeNameConverter Func<Type, Queue, string> The optional function that converts type name to string.
invokeTypeNameConverterForGenericType bool True if typeNameConverter lambda function should be invoked for generic type name such as for the List name in case of List
If the parameter value is false then typeNameConverter is not invoked for the generic type name and only the plain type name is returned.
If the parameter value is true then typeNameConverter must handle generic type definitions carefully and avoid calling
ToNameString() to avoid infinite recursion.

Returns

string

Full type name

ToNameStringWithValueTupleNames(Type type, IList<string> tupleNames, Func<Type, Queue<string>, string> typeNameConverter, bool invokeTypeNameConverterForGenericType)

Convert type to the string. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).

Parameter Type Description
type Type
tupleNames IList The names of the tuple fields from compiler-generated TupleElementNames attribute
typeNameConverter Func<Type, Queue, string> The optional function that converts type name to string.
invokeTypeNameConverterForGenericType bool True if typeNameConverter lambda function should be invoked for generic type name such as for the List name in case of List
If the parameter value is false then typeNameConverter is not invoked for the generic type name and only the plain type name is returned.
If the parameter value is true then typeNameConverter must handle generic type definitions carefully and avoid calling
ToNameString() to avoid infinite recursion.

Returns

string

Full name of the specified type

ToParametersString(MethodBase methodInfo, Func<Type, Queue<string>, string> typeNameConverter, bool invokeTypeNameConverterForGenericType)

Convert method parameters to the string. If method has no parameters then returned string is () If parameters are present then returned string contains parameter names with their type names. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).

Parameter Type Description
methodInfo MethodBase Method information
typeNameConverter Func<Type, Queue, string> The optional function that converts type name to string.
invokeTypeNameConverterForGenericType bool True if typeNameConverter lambda function should be invoked for generic type name such as for the List name in case of List
If the parameter value is false then typeNameConverter is not invoked for the generic type name and only the plain type name is returned.
If the parameter value is true then typeNameConverter must handle generic type definitions carefully and avoid calling
ToNameString() to avoid infinite recursion.

Returns

string

Full list of parameter types and their names

ToTypeNameString(ParameterInfo parameterInfo, Func<Type, Queue<string>, string> typeNameConverter, bool invokeTypeNameConverterForGenericType)

Convert method parameter type to the string. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).

Parameter Type Description
parameterInfo ParameterInfo Parameter information.
typeNameConverter Func<Type, Queue, string> The optional function that converts type name to string.
invokeTypeNameConverterForGenericType bool True if typeNameConverter lambda function should be invoked for generic type name such as for the List name in case of List
If the parameter value is false then typeNameConverter is not invoked for the generic type name and only the plain type name is returned.
If the parameter value is true then typeNameConverter must handle generic type definitions carefully and avoid calling
ToNameString() to avoid infinite recursion.

Returns

string

Full type name of the parameter

ToTypeNameString(MethodInfo methodInfo, Func<Type, Queue<string>, string> typeNameConverter, bool invokeTypeNameConverterForGenericType)

Convert method return value type to the string. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).

Parameter Type Description
methodInfo MethodInfo Method information.
typeNameConverter Func<Type, Queue, string> The optional function that converts type name to string.
invokeTypeNameConverterForGenericType bool True if typeNameConverter lambda function should be invoked for generic type name such as for the List name in case of List
If the parameter value is false then typeNameConverter is not invoked for the generic type name and only the plain type name is returned.
If the parameter value is true then typeNameConverter must handle generic type definitions carefully and avoid calling
ToNameString() to avoid infinite recursion.

Returns

string

Full type name of the return value

ToTypeNameString(PropertyInfo propertyInfo, Func<Type, Queue<string>, string> typeNameConverter, bool invokeTypeNameConverterForGenericType)

Convert property type to the string. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).

Parameter Type Description
propertyInfo PropertyInfo Property information.
typeNameConverter Func<Type, Queue, string> The optional function that converts type name to string.
invokeTypeNameConverterForGenericType bool True if typeNameConverter lambda function should be invoked for generic type name such as for the List name in case of List
If the parameter value is false then typeNameConverter is not invoked for the generic type name and only the plain type name is returned.
If the parameter value is true then typeNameConverter must handle generic type definitions carefully and avoid calling
ToNameString() to avoid infinite recursion.

Returns

string

Full type name of the property

ToTypeNameString(FieldInfo fieldInfo, Func<Type, Queue<string>, string> typeNameConverter, bool invokeTypeNameConverterForGenericType)

Convert field type to the string. Optional typeNameConverter function can convert type names to strings if type names should be decorated in some way either by converting text to markdown or HTML links or adding some formatting.

This method returns ValueTuple types with field names like this (Type1 name1, Type2 name2).

Parameter Type Description
fieldInfo FieldInfo Field information.
typeNameConverter Func<Type, Queue, string> The optional function that converts type name to string.
invokeTypeNameConverterForGenericType bool True if typeNameConverter lambda function should be invoked for generic type name such as for the List name in case of List
If the parameter value is false then typeNameConverter is not invoked for the generic type name and only the plain type name is returned.
If the parameter value is true then typeNameConverter must handle generic type definitions carefully and avoid calling
ToNameString() to avoid infinite recursion.

Returns

string

Full type name of the field

CommonComments Class

Namespace: LoxSmoke.DocXml

Base class for comments classes

Properties

Name Type Summary
Summary string "summary" comment
Remarks string "remarks" comment
Example string "example" comment
Inheritdoc InheritdocTag Inheritdoc tag. Null if missing in comments.
FullCommentText string Full XML comment text
SeeAlso List<SeeAlsoTag> "seealso" links.

DocXmlReader Class

Namespace: LoxSmoke.DocXml

Helper class that reads XML documentation generated by C# compiler from code comments.

Properties

Name Type Summary
UnIndentText bool Default value is true.
When it is set to true DocXmlReader removes leading spaces and an empty
lines at the end of the comment.
By default XML comments are indented for human readability but it adds
leading spaces that are not present in source code.
For example here is compiler generated XML documentation with '-'
showing spaces for readability.
----<summary>
----Text
----</summary>
With UnIndentText set to true returned summary text is just "Text"
With UnIndentText set to false returned summary text contains leading spaces
and the trailing empty line "\n----Text\n----"

Constructors

Name Summary
DocXmlReader(string fileName, bool unindentText) Create reader and use specified XML documentation file
DocXmlReader(XPathDocument xPathDocument, bool unindentText) Create reader for specified xpath document.
DocXmlReader(Func<Assembly, string> assemblyXmlPathFunction, bool unindentText) Open XML documentation files based on assemblies of types. Comment file names
are generated based on assembly names by replacing assembly location with .xml.
DocXmlReader(IEnumerable assemblies, Func<Assembly, string> assemblyXmlPathFunction, bool unindentText) Open XML documentation files based on assemblies of types. Comment file names
are generated based on assembly names by replacing assembly location with .xml.

Methods

Name Returns Summary
GetEnumComments(Type enumType, bool fillValues) EnumComments Get enum type description and comments for enum values. If fillValues
is false and no comments exist for any value then ValueComments list is empty.
GetMemberComment(MemberInfo memberInfo) string Returns Summary comment for specified class member.
GetMemberComments(MemberInfo memberInfo) CommonComments Returns comments for specified class member.
GetMethodComments(MethodBase methodInfo) MethodComments Returns comments for the method or constructor. Returns empty comments object
if comments for method are missing in XML documentation file.
Returned comments tags:
Summary, Remarks, Parameters (if present), Responses (if present), Returns
GetMethodComments(MethodBase methodInfo, bool nullIfNoComment) MethodComments Returns comments for the class method. May return null object is comments for method
are missing in XML documentation file.
Returned comments tags:
Summary, Remarks, Parameters (if present), Responses (if present), Returns
GetSeeAlsoTags(XPathNavigator node) List<SeeAlsoTag>
GetTypeComments(Type type) TypeComments Return Summary comments for specified type.
For Delegate types Parameters field may be returned as well.

Constructors

DocXmlReader(string fileName, bool unindentText)

Create reader and use specified XML documentation file

Parameter Type Description
fileName string The name of the XML documentation file.
unindentText bool True if extra leading spaces should be removed from comments

DocXmlReader(XPathDocument xPathDocument, bool unindentText)

Create reader for specified xpath document.

Parameter Type Description
xPathDocument XPathDocument XML documentation
unindentText bool True if extra leading spaces should be removed from comments

DocXmlReader(Func<Assembly, string> assemblyXmlPathFunction, bool unindentText)

Open XML documentation files based on assemblies of types. Comment file names are generated based on assembly names by replacing assembly location with .xml.

Parameter Type Description
assemblyXmlPathFunction Func<Assembly, string> Function that returns path to the assembly XML comment file.
If function is null then comments file is assumed to have the same file name as assembly.
If function returns null or if comments file does not exist then all comments for types from that
unindentText bool True if extra leading spaces should be removed from comments

DocXmlReader(IEnumerable<Assembly> assemblies, Func<Assembly, string> assemblyXmlPathFunction, bool unindentText)

Open XML documentation files based on assemblies of types. Comment file names are generated based on assembly names by replacing assembly location with .xml.

Parameter Type Description
assemblies IEnumerable<Assembly> The list of assemblies for XML documentation
assemblyXmlPathFunction Func<Assembly, string> Function that returns path to the assembly XML comment file.
If function is null then comments file is assumed to have the same file name as assembly.
If function returns null or if comments file does not exist then all comments for types from that
unindentText bool True if extra leading spaces should be removed from comments

Methods

GetEnumComments(Type enumType, bool fillValues)

Get enum type description and comments for enum values. If fillValues is false and no comments exist for any value then ValueComments list is empty.

Parameter Type Description
enumType Type Enum type to get comments for. If this is not an enum type then functions throws an ArgumentException
fillValues bool True if ValueComments list should be filled even if

Returns

EnumComments

EnumComment

GetMemberComment(MemberInfo memberInfo)

Returns Summary comment for specified class member.

Parameter Type Description
memberInfo MemberInfo

Returns

string

GetMemberComments(MemberInfo memberInfo)

Returns comments for specified class member.

Parameter Type Description
memberInfo MemberInfo

Returns

CommonComments

GetMethodComments(MethodBase methodInfo)

Returns comments for the method or constructor. Returns empty comments object if comments for method are missing in XML documentation file. Returned comments tags: Summary, Remarks, Parameters (if present), Responses (if present), Returns

Returns

MethodComments

GetMethodComments(MethodBase methodInfo, bool nullIfNoComment)

Returns comments for the class method. May return null object is comments for method are missing in XML documentation file. Returned comments tags: Summary, Remarks, Parameters (if present), Responses (if present), Returns

Parameter Type Description
methodInfo MethodBase
nullIfNoComment bool Return null if comment for method is not available

Returns

MethodComments

GetSeeAlsoTags(XPathNavigator node)

Returns

List<SeeAlsoTag>

GetTypeComments(Type type)

Return Summary comments for specified type. For Delegate types Parameters field may be returned as well.

Parameter Type Description
type Type

Returns

TypeComments

TypeComment

EnumComments Class

Namespace: LoxSmoke.DocXml

Base class: CommonComments

Enum type comments

Properties

Name Type Summary
ValueComments List<EnumValueComment> "summary" comments of enum values. List contains names, values and
comments for each enum value.
If none of values have any summary comments then this list may be empty.
If at least one value has summary comment then this list contains
all enum values with empty comments for values without comments.
Summary string "summary" comment
Remarks string "remarks" comment
Example string "example" comment
Inheritdoc InheritdocTag Inheritdoc tag. Null if missing in comments.
FullCommentText string Full XML comment text
SeeAlso List<SeeAlsoTag> "seealso" links.

EnumValueComment Class

Namespace: LoxSmoke.DocXml

Base class: CommonComments

Comment of one enum value

Properties

Name Type Summary
Name string The name of the enum value
Value int Integer value of the enum if enum value fits in signed 32-bit integer.
If value is too big (uint, long or ulong) then returned value is 0.
IsBigValue bool True if enum value is too big to fit in int Value property. Use BigValue property instead.
BigValue BigInteger The value of the enum. This field can handle any enum size.
Summary string "summary" comment
Remarks string "remarks" comment
Example string "example" comment
Inheritdoc InheritdocTag Inheritdoc tag. Null if missing in comments.
FullCommentText string Full XML comment text
SeeAlso List<SeeAlsoTag> "seealso" links.

Methods

Name Returns Summary
ToString() string Debugging-friendly text.

Methods

ToString()

Debugging-friendly text.

Returns

string

InheritdocTag Class

Namespace: LoxSmoke.DocXml

Inheritdoc tag with optional cref attribute.

Properties

Name Type Summary
Cref string Cref attribute value. This value is optional.

MethodComments Class

Namespace: LoxSmoke.DocXml

Base class: CommonComments

Method, operator and constructor comments

Properties

Name Type Summary
Parameters List<(string Name, string Text)> "param" comments of the method. Each item in the list is the tuple where
"Name" is the parameter in XML file and
"Text" is the body of the comment.
Returns string "returns" comment of the method.
Responses List<(string Code, string Text)> "response" comments of the method. The list contains tuples where
"Code" is the response code
"Text" is the body of the comment.
TypeParameters List<(string Name, string Text)> "typeparam" comments of the method. Each item in the list is the tuple where
"Name" of the parameter in XML file and
"Text" is the body of the comment.
Exceptions List<(string Cref, string Text)> "exception" comments of the method or property. Each item in the list is the tuple where
"Cref" is the exception type
"Text" is the description of the exception
Summary string "summary" comment
Remarks string "remarks" comment
Example string "example" comment
Inheritdoc InheritdocTag Inheritdoc tag. Null if missing in comments.
FullCommentText string Full XML comment text
SeeAlso List<SeeAlsoTag> "seealso" links.

SeeAlsoTag Class

Namespace: LoxSmoke.DocXml

Seealso tag with optional cref and href attributes.

Properties

Name Type Summary
Cref string Cref attribute value. This value is optional.
Href string Href attribute value. This value is optional.
Text string The title, if any, for this link.

TypeComments Class

Namespace: LoxSmoke.DocXml

Base class: CommonComments

Class, Struct or delegate comments

Properties

Name Type Summary
Parameters List<(string Name, string Text)> This list contains descriptions of delegate type parameters.
For non-delegate types this list is empty.
For delegate types this list contains tuples where
Name is the "name" attribute of "param"
Text is the body of the comment
TypeParameters List<(string Name, string Text)> This list contains description of generic type parameter
Name is the "name" attribute of "typeparam"
Text is the body of the comment
Summary string "summary" comment
Remarks string "remarks" comment
Example string "example" comment
Inheritdoc InheritdocTag Inheritdoc tag. Null if missing in comments.
FullCommentText string Full XML comment text
SeeAlso List<SeeAlsoTag> "seealso" links.

XmlDocId Class

Namespace: LoxSmoke.DocXml

Class that constructs IDs for XML documentation comments. IDs uniquely identify comments in the XML documentation file.

Methods

Name Returns Summary
EnumValueId(Type enumType, string enumName) string Get XML Id of specified value of the enum type.
EventId(MemberInfo eventInfo) string Get XML Id of event field
FieldId(MemberInfo fieldInfo) string Get XML Id of field
MemberId(MemberInfo memberInfo) string Get XML Id of any member of the type.
MethodId(MethodBase methodInfo) string Get XML Id of a class method
PropertyId(MemberInfo propertyInfo) string Get XML Id of property
TypeId(Type type) string Get XML Id of the type definition.

Fields

Name Type Summary
MemberPrefix char Type member XML ID prefix.
FieldPrefix char Field name XML ID prefix.
PropertyPrefix char Property name XML ID prefix.
EventPrefix char Event XML ID prefix.
TypePrefix char Type name XML ID prefix.
ConstructorNameID string Part of the constructor XML tag in XML document.

Methods

EnumValueId(Type enumType, string enumName)

Get XML Id of specified value of the enum type.

Parameter Type Description
enumType Type Enum type
enumName string The name of the value without type and namespace

Returns

string

EventId(MemberInfo eventInfo)

Get XML Id of event field

Parameter Type Description
eventInfo MemberInfo

Returns

string

FieldId(MemberInfo fieldInfo)

Get XML Id of field

Parameter Type Description
fieldInfo MemberInfo

Returns

string

MemberId(MemberInfo memberInfo)

Get XML Id of any member of the type.

Parameter Type Description
memberInfo MemberInfo

Returns

string

MethodId(MethodBase methodInfo)

Get XML Id of a class method

Parameter Type Description
methodInfo MethodBase

Returns

string

PropertyId(MemberInfo propertyInfo)

Get XML Id of property

Parameter Type Description
propertyInfo MemberInfo

Returns

string

TypeId(Type type)

Get XML Id of the type definition.

Parameter Type Description
type Type

Returns

string

DocXmlReaderExtensions Class

Namespace: LoxSmoke.DocXml.Reflection

DocXmlReader extension methods to retrieve type properties, methods, and fields using reflection information.

Methods

Name Returns Summary
Comments(DocXmlReader reader, IEnumerable propInfos) IEnumerable<(PropertyInfo Info, CommonComments Comments)> Get comments for the collection of properties.
Comments(DocXmlReader reader, IEnumerable methodInfos) IEnumerable<(MethodBase Info, MethodComments Comments)> Get comments for the collection of methods.
Comments(DocXmlReader reader, IEnumerable fieldInfos) IEnumerable<(FieldInfo Info, CommonComments Comments)> Get comments for the collection of fields.

Methods

Comments(DocXmlReader reader, IEnumerable<PropertyInfo> propInfos)

Get comments for the collection of properties.

Parameter Type Description
reader DocXmlReader
propInfos IEnumerable<PropertyInfo>

Returns

IEnumerable<(PropertyInfo Info, CommonComments Comments)>

Comments(DocXmlReader reader, IEnumerable<MethodBase> methodInfos)

Get comments for the collection of methods.

Parameter Type Description
reader DocXmlReader
methodInfos IEnumerable<MethodBase>

Returns

IEnumerable<(MethodBase Info, MethodComments Comments)>

Comments(DocXmlReader reader, IEnumerable<FieldInfo> fieldInfos)

Get comments for the collection of fields.

Parameter Type Description
reader DocXmlReader
fieldInfos IEnumerable<FieldInfo>

Returns

IEnumerable<(FieldInfo Info, CommonComments Comments)>

ReflectionSettings Class

Namespace: LoxSmoke.DocXml.Reflection

Settings used by TypeCollection to retrieve reflection info.

Properties

Name Type Summary
Default ReflectionSettings Default reflection settings.
PropertyFlags BindingFlags Binding flags to use when retrieving properties of the type.
MethodFlags BindingFlags Binding flags to use when retrieving methods of the type.
FieldFlags BindingFlags Binding flags to use when retrieving fields of the type.
NestedTypeFlags BindingFlags Binding flags to use when retrieving nested types of the type.
AssemblyFilter Func<Assembly, bool> Function that checks if specified types of assembly should be added to the set of the
referenced types.
Return true if referenced types of the assembly should be examined.
Return false if assembly types should be ignored.
Default implementation checks if documentation XML file exists for the assembly and if
it does then returns true.
TypeFilter Func<Type, bool> Checks if specified type should be added to the set of referenced types.
Return true if type and types referenced by it should be examined.
Function should return false if type should be ignored.
Default implementation returns true for all types.
PropertyFilter Func<PropertyInfo, bool> Checks if specified property should be added to the list of properties and the
set of referenced types.
Return true if property and types referenced by it should be examined.
Function should return false if property should be ignored.
Default implementation returns true for all properties.
MethodFilter Func<MethodBase, bool> Checks if specified method should be added to the list of methods and the
set of referenced types.
Return true if the method and types referenced by it should be examined.
Function should return false if method should be ignored.
Default implementation returns true for all methods.
FieldFilter Func<FieldInfo, bool> Checks if specified field should be added to the list of fields and the
set of referenced types.
Return true if field and types referenced by it should be examined.
Function should return false if field should be ignored.
Default implementation returns true for all fields.

TypeCollection Class

Namespace: LoxSmoke.DocXml.Reflection

Collection of type information objects.

Properties

Name Type Summary
Settings ReflectionSettings Reflection settings that should be used when looking for referenced types.
ReferencedTypes Dictionary<Type, TypeInformation> All referenced types.
VisitedPropTypes HashSet<Type> Types that had their data and functions examined.
PendingPropTypes Queue<Type> Types that need to have their properties, methods and fields examined.
CheckAssemblies Dictionary<Assembly, bool> Cached information from ExamineAssemblies call.
Contains the set of assemblies that should be checked or ignored.
IgnoreTypes HashSet<Type> Cached information from the ExamineTypes call.
Contains the set of types that should be ignored.

Methods

Name Returns Summary
ForReferencedTypes(Type type, ReflectionSettings settings) TypeCollection Get all types referenced by the specified type.
Reflection information for the specified type is also returned.
ForReferencedTypes(Assembly assembly, ReflectionSettings settings) TypeCollection Get all types referenced by the types from specified assembly.
ForReferencedTypes(IEnumerable assemblies, ReflectionSettings settings) TypeCollection Get all types referenced by the types from the list of assemblies.
GetReferencedTypes(Type type, ReflectionSettings settings) void Get all types referenced by the specified type.
Reflection information for the specified type is also returned.
GetReferencedTypes(Assembly assembly, ReflectionSettings settings) void Get all types referenced by the types from specified assembly.
GetReferencedTypes(IEnumerable assemblies, ReflectionSettings settings) void Get all types referenced by the types from specified assemblies.
Reflection information for the specified type is also returned.
UnwrapType(Type parentType, Type type) void Recursively "unwrap" the generic type or array. If type is not generic and not an array
then do nothing.

Methods

ForReferencedTypes(Type type, ReflectionSettings settings)

Get all types referenced by the specified type. Reflection information for the specified type is also returned.

Parameter Type Description
type Type
settings ReflectionSettings

Returns

TypeCollection

ForReferencedTypes(Assembly assembly, ReflectionSettings settings)

Get all types referenced by the types from specified assembly.

Parameter Type Description
assembly Assembly
settings ReflectionSettings

Returns

TypeCollection

ForReferencedTypes(IEnumerable<Assembly> assemblies, ReflectionSettings settings)

Get all types referenced by the types from the list of assemblies.

Parameter Type Description
assemblies IEnumerable<Assembly>
settings ReflectionSettings

Returns

TypeCollection

GetReferencedTypes(Type type, ReflectionSettings settings)

Get all types referenced by the specified type. Reflection information for the specified type is also returned.

Parameter Type Description
type Type
settings ReflectionSettings

GetReferencedTypes(Assembly assembly, ReflectionSettings settings)

Get all types referenced by the types from specified assembly.

Parameter Type Description
assembly Assembly
settings ReflectionSettings

GetReferencedTypes(IEnumerable<Assembly> assemblies, ReflectionSettings settings)

Get all types referenced by the types from specified assemblies. Reflection information for the specified type is also returned.

Parameter Type Description
assemblies IEnumerable<Assembly>
settings ReflectionSettings

UnwrapType(Type parentType, Type type)

Recursively "unwrap" the generic type or array. If type is not generic and not an array then do nothing.

Parameter Type Description
parentType Type
type Type

TypeInformation Class

Namespace: LoxSmoke.DocXml.Reflection

Reflection information for the class, its methods, properties and fields.

Properties

Name Type Summary
Type Type The type that this class describes
ReferencesIn HashSet<Type> Other types referencing this type.
ReferencesOut HashSet<Type> Other types referenced by this type.
Properties List<PropertyInfo> The list of property inforation of the class.
Methods List<MethodBase> The list of method inforation of the class.
Fields List<FieldInfo> The list of field inforation of the class.