DiagnosticItem Class

One single diagnostics item/issue, containing one message.

A message can have a number of DiagnosticsValue attached, giving a number and a item type. The unit is always the default unit of the type (SI).

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 class DiagnosticItem : IDiagnosticItem
Inheritance
Object    DiagnosticItem
Derived
Implements
IDiagnosticItem

Constructors

DiagnosticItem Constructor for derived classes
DiagnosticItem(String) Create diagnostic item without values
DiagnosticItem(String, ListDiagnosticsValue) Create diagnostic item with list of values
DiagnosticItem(String, Object) Create diagnostic item with list of values

Properties

AdditionalInfo Additional information about diagnostics item. Used to append time step information to errors in HDModule.
Diagnostics The diagnostics that the item belongs to.

This is automatically set when item is added to diagnostics object.

Hint Diagnostics hint
Location Location of message
Message Diagnostics message with value placeholders replaced by values. Value place holder can be modified by setting the Tokens.
MessageID ID of error in item.

Each kind of error will have an id which does not change between computers. The Message change, if localized messages exist for the system language.

MessageNoValues Diagnostics message
Tokens Set tokens for each of the Values. Defaults to {0}, {1}, {2} etc
Values Diagnostic values

Methods

CheckNumberOfValues Check if number of diagnostic values matches number of brackets
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetMessage Diagnostics message with value placeholders replaced by values. Value place holder can be modified by setting the Tokens.
GetTypeGets the Type of the current instance.
(Inherited from Object)
HandleValues Examine each arg and put it into an appropriate diagnostic value
HasHint Returns true if this item has an associated hint. The hint can be accessed throught the Hint property.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
NumberOfValues Return the number of values that this item expects
SetLocation(String) Location of error message
SetLocation(DiagnosticsLocationType, String) Location of error message
SetLocation(String, Double) Location of error message
ToStringReturns a string that represents the current object.
(Inherited from Object)

Fields

_location Location where item was generated
_message Actual message
_messageId ID of message
_values Values associated with item

See Also