IDiagnostics Interface

Interface for communication of Errors, Warnings and Hints It also includes a tree like strukture of IDiagnostics, called Children, to be able to handle the diagnostics in a stack-trace manner. Whenever a new issue is added, the DiagnosticsEvent is triggered on the IDiagnostics self and all its parents.

Definition

Namespace: DHI.Mike1D.Generic
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public interface IDiagnostics

Properties

Children Implements a recursive tree like structure of IDiagnostics
ErrorCountRecursive The number of errors in this Diagnostics and its children
Errors Get a list of errors in this diagnostics
ErrorsRecursive Get a list of all errors, also from child diagnostics
HintCountRecursive The number of hints in this Diagnostics and its children
Hints Get a list of all hints
HintsRecursive Get a list of all errors
Infos Get a list of all informations
IssueCount The number of issues in this diagnostics
IssueCountRecursive The number of issues in this Diagnostics and its children
Name Name/id of Diagnostics. Can be null/empty string.
Parent Get the parent diagnostics - null if not parent is defined
Source Source object that created the diagnostics
SourceDescription Description of Diagnostics source. Can be null/empty string. Can contain values that requires unit conversion.
WarningCountRecursive The number of warnings in this Diagnostics and its children
Warnings Get a list of warnings in this diagnostics
WarningsRecursive Get a list of all errors

Methods

AddChild Add a child diagnostics to the diagnostics tree. Sets the parent of the child.
Append Append errors, warnings and hints from input diagnostics to this diagnostics
Clear Clear diagnostics, all errors, warnings and hints.
ClearIssuesRecursive Remove Errors, hints, and warnings from the diagnostics and all child diagnostics
Error Add an error DiagnosticItem
Hint Add a hint DiagnosticItem
Info(IDiagnosticItem) Add a information DiagnosticItem
Info(String) Add a information messaeg
IsParent Return true of diagnostics is parent or parent's parent
RuntimeError(IDiagnosticItem) Add an error DiagnosticItem, and throw an exception
RuntimeError(IDiagnosticItem, Exception) Add an error DiagnosticItem, and throw an exception
Warning Add a warning DiagnosticItem

Events

DiagnosticsEvent The event which is called when a diagnostics event is encountered.

Extension Methods

Error Add an error to the diagnostics item.
(Defined by GenericExtensions)
ExceptionToError Add an error DiagnosticItem, and throw an exception
(Defined by GenericExtensions)
RuntimeError Add an error DiagnosticItem, and throw an exception
(Defined by GenericExtensions)
Warning Add a warning message
(Defined by GenericExtensions)

See Also