Table of Contents

Struct ReportLevel

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Defines (importance-) levels used for logging individual messages.

[TypeConverter(typeof(ReportLevel.ReportLevelConverter))]
public struct ReportLevel : IComparable, IComparable<ReportLevel>, IEquatable<ReportLevel>, IFormattable
Implements
Inherited Members

Constructors

ReportLevel(string, int, string)

Constructs a new report level.

public ReportLevel(string name, int level, string customStyle)

Parameters

name string

The name of the level.

level int

The actual level value used to compare this instance to other instances.

customStyle string

A custom formatting style for this report level for use in the XML report. Null for default style.

Fields

Always

Indicates that report messages with this level will always be logged regardless of the level set to MinimumReportLevel.

public static readonly ReportLevel Always

Field Value

ReportLevel

Debug

Indicates a debug/trace message, typically used during development.

public static readonly ReportLevel Debug

Field Value

ReportLevel

Error

Indicates an error, usually of severe nature.

public static readonly ReportLevel Error

Field Value

ReportLevel

Failure

Indicates the failed execution of a test step.

public static readonly ReportLevel Failure

Field Value

ReportLevel

Info

Indicates a general informational message.

public static readonly ReportLevel Info

Field Value

ReportLevel

Inherit

Indicates that the log level for a TestCaseNode should be inherited from its parent. Use this level only for setting the ReportLevel property.

public static readonly ReportLevel Inherit

Field Value

ReportLevel

Remarks

Only for use with ReportLevel.

Success

Indicates the successful execution of a test step.

public static readonly ReportLevel Success

Field Value

ReportLevel

Warn

Indicates a warning, e.g. an usual event or a recoverable error.

public static readonly ReportLevel Warn

Field Value

ReportLevel

Properties

CustomStyle

Gets the custom CSS style of the report level. Is set to null if the default specified by the Ranorex stylesheet is to be used.

public string CustomStyle { get; }

Property Value

string

Level

Gets the actual level value used to compare this instance to other instances.

public int Level { get; }

Property Value

int

Name

Gets the name of this level.

public string Name { get; }

Property Value

string

StandardErrorValues

Gets an array of the standard warning/error report levels.

public static ReportLevel[] StandardErrorValues { get; }

Property Value

ReportLevel[]

StandardValues

Gets an array of the standard report levels.

public static ReportLevel[] StandardValues { get; }

Property Value

ReportLevel[]

Methods

CompareTo(ReportLevel)

Compares the current instance with another report level.

public int CompareTo(ReportLevel other)

Parameters

other ReportLevel

A report level to compare with this instance.

Returns

int

A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings:

ValueMeaning
Less than zeroThis instance is less than other.
ZeroThis instance is equal to other.
Greater than zeroThis instance is greater than other.

CompareTo(object)

Compares the current instance with another object of the same type.

public int CompareTo(object obj)

Parameters

obj object

An object to compare with this instance.

Returns

int

A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings:

ValueMeaning
Less than zeroThis instance is less than obj.
ZeroThis instance is equal to obj.
Greater than zeroThis instance is greater than obj.

Exceptions

ArgumentException

obj is not of type ReportLevel.

Equals(ReportLevel)

Indicates whether the current object is equal to another object.

public bool Equals(ReportLevel other)

Parameters

other ReportLevel

Another object.

Returns

bool

True if the current object is equal to the other parameter; otherwise false.

Equals(object)

Determines whether the specified object is equal to the current instance.

public override bool Equals(object obj)

Parameters

obj object

Another object.

Returns

bool

True if the specified object is equal to the current instance; otherwise false.

GetHashCode()

Computes a hash for this instance.

public override int GetHashCode()

Returns

int

A hash code for the current object.

IsStandardValue(ReportLevel)

Determines whether the specified report level is a standard report level.

public static bool IsStandardValue(ReportLevel reportLevel)

Parameters

reportLevel ReportLevel

A report level.

Returns

bool

true if the specified report level is one of the StandardValues; otherwise, false.

Parse(string)

Parses reportLevelString and returns a new ReportLevel instance.

public static ReportLevel Parse(string reportLevelString)

Parameters

reportLevelString string

A string representing a report level.

Returns

ReportLevel

A new ReportLevel corresponding to reportLevelString.

Exceptions

ArgumentNullException

If reportLevelString is null.

FormatException

If reportLevelString has an invalid format.

ToString()

Returns a string represenation of this instance.

public override string ToString()

Returns

string

A string representation of this instance.

ToString(IFormatProvider)

Returns a string represenation of this instance.

public string ToString(IFormatProvider formatProvider)

Parameters

formatProvider IFormatProvider

The IFormatProvider to use or null to obtain the format information from the current locale setting of the operating system.

Returns

string

A string representation of this instance.

ToString(string)

Returns a string represenation of this instance.

public string ToString(string format)

Parameters

format string

The string specifying the format to use or null to use the default format.

Returns

string

A string representation of this instance.

Remarks

See the documentation of the ToString(string, IFormatProvider) method for available format identifiers.

ToString(string, IFormatProvider)

Returns a string represenation of this instance.

public string ToString(string format, IFormatProvider formatProvider)

Parameters

format string

The string specifying the format to use or null to use the default format.

formatProvider IFormatProvider

The IFormatProvider to use or null to obtain the format information from the current locale setting of the operating system.

Returns

string

A string representation of this instance.

Remarks

The following string values are valid for format:

Format StringDescription and Associated Properties
gGeneral format. Returns the Name of the report level.
hHuman readable format. "g" format is used if this instance is one of the StandardValues; otherwise "r" format is used.
rRound-trip (serialization) format. Returns a string representation containing all the information to create the instance again using the Parse(string) method.
dDecimal format. Returns the Level in decimal form. See ToString(string, IFormatProvider) for more info.
xHexadecimal format. Returns the Level in hexadecimal form. See ToString(string, IFormatProvider) for more info.

TryParse(string, out ReportLevel)

Tries parsing reportLevelString to a ReportLevel instance.

public static bool TryParse(string reportLevelString, out ReportLevel reportLevel)

Parameters

reportLevelString string

A string representing a report level.

reportLevel ReportLevel

When this method returns, contains a ReportLevel instance if parsing succeeded, null otherwise.

Returns

bool

True if parsing succeeded, otherwise false.

Operators

operator ==(ReportLevel, ReportLevel)

Implements the operator ==.

public static bool operator ==(ReportLevel r1, ReportLevel r2)

Parameters

r1 ReportLevel

The r1.

r2 ReportLevel

The r2.

Returns

bool

Returns whether r1 and r2 are equal.

operator >(ReportLevel, ReportLevel)

Implements the operator >.

public static bool operator >(ReportLevel r1, ReportLevel r2)

Parameters

r1 ReportLevel

The r1.

r2 ReportLevel

The r2.

Returns

bool

Returns whether r1 is greater than r2.

operator >=(ReportLevel, ReportLevel)

Implements the operator >=.

public static bool operator >=(ReportLevel r1, ReportLevel r2)

Parameters

r1 ReportLevel

The r1.

r2 ReportLevel

The r2.

Returns

bool

Returns whether r1 is greater than or equal to r2.

operator !=(ReportLevel, ReportLevel)

Implements the operator !=.

public static bool operator !=(ReportLevel r1, ReportLevel r2)

Parameters

r1 ReportLevel

The r1.

r2 ReportLevel

The r2.

Returns

bool

Returns whether r1 and r2 are not equal.

operator <(ReportLevel, ReportLevel)

Implements the operator <.

public static bool operator <(ReportLevel r1, ReportLevel r2)

Parameters

r1 ReportLevel

The r1.

r2 ReportLevel

The r2.

Returns

bool

Returns whether r1 is less than r2.

operator <=(ReportLevel, ReportLevel)

Implements the operator <=.

public static bool operator <=(ReportLevel r1, ReportLevel r2)

Parameters

r1 ReportLevel

The r1.

r2 ReportLevel

The r2.

Returns

bool

Returns whether r1 is less than or equal to r2.