Table of Contents

Interface IAlertService

Namespace
Csra.Interfaces
Assembly
Csra.dll
public interface IAlertService : IServiceBase
Inherited Members

Properties

ErrorTarget

Reads or sets the output target for Error Alerts. Defaults to OutputWindow and Datalog, which cannot be disabled.

AlertOutputTarget ErrorTarget { get; set; }

Property Value

AlertOutputTarget

InfoTarget

Reads or sets the output target for Info Alerts. Defaults to OutputWindow, which cannot be disabled.

AlertOutputTarget InfoTarget { get; set; }

Property Value

AlertOutputTarget

LogTarget

Reads or sets the output target for Log Alerts. Defaults to OutputWindow, which cannot be disabled.

AlertOutputTarget LogTarget { get; set; }

Property Value

AlertOutputTarget

OutputFile

Reads or sets the file path for the output file.

string OutputFile { get; set; }

Property Value

string

TimeStamp

Reads or sets whether a time stamp is added to Info / Warning and Error Alerts.

bool TimeStamp { get; set; }

Property Value

bool

WarningTarget

Reads or sets the output target for Warning Alerts. Defaults to OutputWindow and Datalog, which cannot be disabled.

AlertOutputTarget WarningTarget { get; set; }

Property Value

AlertOutputTarget

Methods

Error(string, int, string)

Sends an Error Alert message to the selected output target(s). At test program runtime, this raises an exception to the IG-XL error handler. If called during validation, it fails validation and flags the error appropriately. Use this for non-recoverable conditions that require immediate and safe termination. Note: The compiler does not recognize that this method never returns, so you may need extra checks to satisfy .NET Framework requirements.

void Error(string error, int validationArgumentIndex = 0, string doNotSpecify = "")

Parameters

error string

The Error Alert message.

validationArgumentIndex int

Optional. The offending test instance argument index (one-based), if applicable when used in validation.

doNotSpecify string

DO NOT SPECIFY - the name of the calling method is automatically inserted by the compiler.

Error<TException>(string, int, string)

Sends an Error Alert message to the selected output target(s). At test program runtime, this raises a user-selectable exception to the IG-XL error handler. If called during validation, it fails validation and flags the error appropriately. Use this for non-recoverable conditions that require immediate and safe termination. Note: The compiler does not recognize that this method never returns, so you may need extra checks to satisfy .NET Framework requirements.

void Error<TException>(string error, int validationArgumentIndex = 0, string doNotSpecify = "") where TException : Exception

Parameters

error string

The Error Alert message.

validationArgumentIndex int

Optional. The offending test instance argument index (one-based), if applicable when used in validation.

doNotSpecify string

DO NOT SPECIFY - the name of the calling method is automatically inserted by the compiler.

Type Parameters

TException

The type of the exception to be thrown.

Info(string, string)

Sends an Info Alert message to the selected output target(s). Use for positive / neutral information relevant to the user.

void Info(string info, string doNotSpecify = "")

Parameters

info string

The Info Alert message.

doNotSpecify string

DO NOT SPECIFY - the name of the calling method is automatically inserted by the compiler.

Log(string, byte, byte, byte, bool)

Sends a Log Alert message to the selected output target(s).

void Log(string message, byte red, byte green, byte blue, bool bold = false)

Parameters

message string

The message string to be logged.

red byte

The red component of a RGB color.

green byte

The green component of a RGB color.

blue byte

The blue component of a RGB color.

bold bool

Optional. Whether bold font is used (OutputWindow only, ignored elsewhere).

Log(string, ColorConstants, bool)

Sends a Log Alert message to the selected output target(s).

void Log(string message, ColorConstants color = ColorConstants.Black, bool bold = false)

Parameters

message string

The message string to be logged.

color ColorConstants

Optional. The color to be used (OutputWindow only, ignored elsewhere).

bold bool

Optional. Whether bold font is used (OutputWindow only, ignored elsewhere).

LogToFile(string, string)

Sends a Log message to the specified log file.

void LogToFile(string logLabel, string message)

Parameters

logLabel string

The label for the log file.

message string

The message string to be logged.

Warning(string, string)

Sends a Warning Alert message to the selected output target(s). Use for recoverable issues that may require attention.

void Warning(string warning, string doNotSpecify = "")

Parameters

warning string

The Warning Alert message.

doNotSpecify string

DO NOT SPECIFY - the name of the calling method is automatically inserted by the compiler.