It is thread safe, i.e. it handles synchronization issues between potential several worker threads.
To connect a diagnostics object for "live" messages, connect
the DiagnosticsHandler object directly to the Diagnostics object:
diagnostics.DiagnosticsEvent += diagnosticsHandler.Write;
To write all messages of a diagnostics object, call the
WriteAllIssuesRecursive(IDiagnostics) method.
public class DiagnosticsHandler| DiagnosticsHandler | Constructor |
| Heading | If diagnostic items are generated, then this heading is printed before the items. Immediately after the Heading is reset (hence only written once). |
| NumberOfIdenticalMessagesToWrite |
Number of identical messages to write.
If more than this number of messages (same message id), these messages are skipped for the MessageEvent. |
| UnitProvider | Unit provider, for unit conversions |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| GetHashCode | Serves as the default hash function. (Inherited from Object) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
| NewMessage | Create directly a new message to be sent on |
| Reset | Reset DiagnosticsHandler, clearing counters for error messages and any pending messages in the queue |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| Write | Print one item of a Diagnostics to listeners. Can be used to connect to DiagnosticsEvent of another Diagnostics object, to transfer any items to this class. |
| WriteAllIssuesRecursive | Print hints, warnings, and erros of a Diagnostics to the listeners. Calls all children recursively. |
| WriteSkippedMessagesSummary | Print a summary of hints, warnings, and erros that has been skipped. |
| MessageEvent |
Event that is triggered every time a new diagnostics message is produced
by one of the connected diagnostics objects.
The number of identical messages is limited by _numberOfIdenticalMessagesToWrite Parameters: Type of message and message content. |
| MessageEventAll |
Event that is triggered every time a new diagnostics message is produced
by one of the connected diagnostics objects.
Parameters: Type of message, message id and message content Message id can be null. |