Show / Hide Table of Contents

Class DiagnosticMessageFactory

Represents a class that can be used to create instances of classes deriving from the DiagnosticMessage class. The main benefit of using this class is automatic and consistent message identifier generation.

Inheritance
System.Object
DiagnosticMessageFactory
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Juhta.Net.Diagnostics
Assembly: Juhta.Net.dll
Syntax
public class DiagnosticMessageFactory

Constructors

| Improve this Doc View Source

DiagnosticMessageFactory(Int32, String)

Initializes a new instance.

Declaration
public DiagnosticMessageFactory(int messageIdBase, string messageNamespace)
Parameters
Type Name Description
System.Int32 messageIdBase

Specifies a base value for the message identifiers.

System.String messageNamespace

Specifies a namespace for messages to create.

| Improve this Doc View Source

DiagnosticMessageFactory(Int32, String, String, String, String)

Initializes a new instance.

Declaration
public DiagnosticMessageFactory(int messageIdBase, string informationMessageIdPrefix, string warningMessageIdPrefix, string errorMessageIdPrefix, string alertMessageIdPrefix)
Parameters
Type Name Description
System.Int32 messageIdBase

Specifies a base value for the message identifiers.

System.String informationMessageIdPrefix

Specifies a prefix for information message identifiers. Can be null.

System.String warningMessageIdPrefix

Specifies a prefix for warning message identifiers. Can be null.

System.String errorMessageIdPrefix

Specifies a prefix for error message identifiers. Can be null.

System.String alertMessageIdPrefix

Specifies a prefix for alert message identifiers. Can be null.

Remarks

Identifiers of created diagnostic messages will start from messageIdBase + 1 in ascending order.

Methods

| Improve this Doc View Source

CreateAlertMessage(String)

Creates an AlertMessage instance based on a specified message.

Declaration
public AlertMessage CreateAlertMessage(string message)
Parameters
Type Name Description
System.String message

Specifies a message. The message can contain format items.

Returns
Type Description
AlertMessage

Returns the created AlertMessage instance.

| Improve this Doc View Source

CreateAlertMessage(String, Int32)

Creates an AlertMessage instance based on a specified message.

Declaration
public AlertMessage CreateAlertMessage(string message, int messageIdOffset)
Parameters
Type Name Description
System.String message

Specifies a message. The message can contain format items.

System.Int32 messageIdOffset

Specifies an offset that determines the message identifier to associate with the AlertMessage instance.

Returns
Type Description
AlertMessage

Returns the created AlertMessage instance.

| Improve this Doc View Source

CreateErrorMessage(String)

Creates an ErrorMessage instance based on a specified message.

Declaration
public ErrorMessage CreateErrorMessage(string message)
Parameters
Type Name Description
System.String message

Specifies a message. The message can contain format items.

Returns
Type Description
ErrorMessage

Returns the created ErrorMessage instance.

| Improve this Doc View Source

CreateErrorMessage(String, Int32)

Creates an ErrorMessage instance based on a specified message.

Declaration
public ErrorMessage CreateErrorMessage(string message, int messageIdOffset)
Parameters
Type Name Description
System.String message

Specifies a message. The message can contain format items.

System.Int32 messageIdOffset

Specifies an offset that determines the message identifier to associate with the ErrorMessage instance.

Returns
Type Description
ErrorMessage

Returns the created ErrorMessage instance.

| Improve this Doc View Source

CreateInformationMessage(String)

Creates an InformationMessage instance based on a specified message.

Declaration
public InformationMessage CreateInformationMessage(string message)
Parameters
Type Name Description
System.String message

Specifies a message. The message can contain format items.

Returns
Type Description
InformationMessage

Returns the created InformationMessage instance.

| Improve this Doc View Source

CreateInformationMessage(String, Int32)

Creates an InformationMessage instance based on a specified message.

Declaration
public InformationMessage CreateInformationMessage(string message, int messageIdOffset)
Parameters
Type Name Description
System.String message

Specifies a message. The message can contain format items.

System.Int32 messageIdOffset

Specifies an offset that determines the message identifier to associate with the InformationMessage instance.

Returns
Type Description
InformationMessage

Returns the created InformationMessage instance.

| Improve this Doc View Source

CreateWarningMessage(String)

Creates a WarningMessage instance based on a specified message.

Declaration
public WarningMessage CreateWarningMessage(string message)
Parameters
Type Name Description
System.String message

Specifies a message. The message can contain format items.

Returns
Type Description
WarningMessage

Returns the created WarningMessage instance.

| Improve this Doc View Source

CreateWarningMessage(String, Int32)

Creates a WarningMessage instance based on a specified message.

Declaration
public WarningMessage CreateWarningMessage(string message, int messageIdOffset)
Parameters
Type Name Description
System.String message

Specifies a message. The message can contain format items.

System.Int32 messageIdOffset

Specifies an offset that determines the message identifier to associate with the WarningMessage instance.

Returns
Type Description
WarningMessage

Returns the created WarningMessage instance.

  • Improve this Doc
  • View Source
Back to top Copyright © 2017-2019 Juha Lähteenmäki
Generated by DocFX