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
InfoTarget
Reads or sets the output target for Info Alerts. Defaults to OutputWindow, which cannot be disabled.
AlertOutputTarget InfoTarget { get; set; }
Property Value
LogTarget
Reads or sets the output target for Log Alerts. Defaults to OutputWindow, which cannot be disabled.
AlertOutputTarget LogTarget { get; set; }
Property Value
OutputFile
Reads or sets the file path for the output file.
string OutputFile { get; set; }
Property Value
TimeStamp
Reads or sets whether a time stamp is added to Info / Warning and Error Alerts.
bool TimeStamp { get; set; }
Property Value
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
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
errorstringThe Error Alert message.
validationArgumentIndexintOptional. The offending test instance argument index (one-based), if applicable when used in validation.
doNotSpecifystringDO 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
errorstringThe Error Alert message.
validationArgumentIndexintOptional. The offending test instance argument index (one-based), if applicable when used in validation.
doNotSpecifystringDO NOT SPECIFY - the name of the calling method is automatically inserted by the compiler.
Type Parameters
TExceptionThe 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
infostringThe Info Alert message.
doNotSpecifystringDO 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
messagestringThe message string to be logged.
redbyteThe red component of a RGB color.
greenbyteThe green component of a RGB color.
bluebyteThe blue component of a RGB color.
boldboolOptional. 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
messagestringThe message string to be logged.
colorColorConstantsOptional. The color to be used (OutputWindow only, ignored elsewhere).
boldboolOptional. 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
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 = "")