Click or drag to resize

Diagnostics Class

A collection of error, warning and hint messages. It implements a tree like strukture of IDiagnostics, to be able to handle the diagnostics in a stack-trace like manner. Whenever an item is added, an event is triggered. Calling any of the recursive method must be done from one thread at a time only, otherwise it will fail.
Inheritance Hierarchy
SystemObject
  DHI.Mike1D.GenericDiagnostics

Namespace:  DHI.Mike1D.Generic
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class Diagnostics : IDiagnostics

The Diagnostics type exposes the following members.

Constructors
  NameDescription
Public methodDiagnostics
Create a new unnamed Diagnostics. Use only if this diagnostics at a later stage is appended to a named diagnostics.
Public methodDiagnostics(String)
Create a new named Diagnostics
Public methodDiagnostics(IDiagnosticItem)
Create a new named Diagnostics
Public methodDiagnostics(String, Object)
Create a new named Diagnostics
Top
Properties
  NameDescription
Public propertyChildren
Children of sub-diagnostics, implementing a tree-like structure of Diagnostics. If you add children to the list, remember to se teh parent - or use AddChild().
Public propertyErrorCountRecursive
The number of issues in this diagnostics, including issues in the stack.
Public propertyErrors
Get a list of all errors (not from the stack)
Public propertyErrorsRecursive
Get a list of all errors, recursively
Public propertyHintCountRecursive
The number of warnings in this diagnostics, including warnings in the stack.
Public propertyHints
Get a list of all hints (not from the stack)
Public propertyHintsRecursive
Get a list of all warnings, recursively
Public propertyInfos
Get a list of all hints (not from the stack)
Public propertyIssueCount
The number of issues in this diagnostics
Public propertyIssueCountRecursive
The number of issues in this diagnostics, including issues in the stack.
Public propertyName
Name or origin of Diagnostics. Can be null/empty string.
Public propertyParent
Parent diagnostic. Diagnostics can belong to a tree with one parent and several children. If parent is null, then this diagnostic is the root.
Public propertySource
Source object that created the Diagnostics
Public propertySourceDescription
Description of Diagnostics source. Can be null/empty string.
Public propertyWarningCountRecursive
The number of warnings in this diagnostics, including warnings in the stack.
Public propertyWarnings
Get a list of all warnings (not from the stack)
Public propertyWarningsRecursive
Get a list of all warnings, recursively
Top
Methods
  NameDescription
Public methodAddChild
Add a child diagnostics to the diagnostics tree. Sets the parent of the child.
Public methodAppend
Append errors, warnings and hints from input diagnostics to this diagnostics, and add stack items
Public methodClear
Clear diagnostics, as well errors as warnings as hints as stack.
Public methodClearIssuesRecursive
Remove all issues from this Diagnostics and all child Diagnostics
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodError
Add an error DiagnosticItem
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHint
Add a hint DiagnosticItem
Public methodInfo(String)
Add an information DiagnosticItem
Public methodInfo(IDiagnosticItem)
Add an information DiagnosticItem
Public methodIsParent
Return true if diagnostics is the parent of this diagnostics. It checks the parent recursively to the root.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRuntimeError(IDiagnosticItem)
Create an error DiagnosticItem and throw an exception
Public methodRuntimeError(IDiagnosticItem, Exception)
Create an error DiagnosticItem and throw an exception
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWarning
Add a warning DiagnosticItem
Top
Events
  NameDescription
Public eventDiagnosticsEvent
The event which is called when a diagnostics event is encountered. If this is null, then the event of the root diagnostic (the parent's parent until parent is null) is called.
Top
Fields
  NameDescription
Public fieldGetAdditionalInformation
Delegate to access additional information to add to items. Used to append time step information to items from HD.
Public fieldMessageIdToWarning
ID of messages that, if reported as errors, are reported as warnings
Top
Extension Methods
  NameDescription
Public Extension MethodError
Add an error to the diagnostics item.
(Defined by GenericExtensions.)
Public Extension MethodExceptionToError
Add an error DiagnosticItem, and throw an exception
(Defined by GenericExtensions.)
Public Extension MethodRuntimeError
Add an error DiagnosticItem, and throw an exception
(Defined by GenericExtensions.)
Public Extension MethodWarning
Add a warning message
(Defined by GenericExtensions.)
Top
See Also