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
namestringThe name of the level.
levelintThe actual level value used to compare this instance to other instances.
customStylestringA 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
Debug
Indicates a debug/trace message, typically used during development.
public static readonly ReportLevel Debug
Field Value
Error
Indicates an error, usually of severe nature.
public static readonly ReportLevel Error
Field Value
Failure
Indicates the failed execution of a test step.
public static readonly ReportLevel Failure
Field Value
Info
Indicates a general informational message.
public static readonly ReportLevel Info
Field Value
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
Remarks
Only for use with ReportLevel.
Success
Indicates the successful execution of a test step.
public static readonly ReportLevel Success
Field Value
Warn
Indicates a warning, e.g. an usual event or a recoverable error.
public static readonly ReportLevel Warn
Field Value
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
Level
Gets the actual level value used to compare this instance to other instances.
public int Level { get; }
Property Value
Name
Gets the name of this level.
public string Name { get; }
Property Value
StandardErrorValues
Gets an array of the standard warning/error report levels.
public static ReportLevel[] StandardErrorValues { get; }
Property Value
StandardValues
Gets an array of the standard report levels.
public static ReportLevel[] StandardValues { get; }
Property Value
Methods
CompareTo(ReportLevel)
Compares the current instance with another report level.
public int CompareTo(ReportLevel other)
Parameters
otherReportLevelA 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:
Value Meaning Less than zero This instance is less than other.Zero This instance is equal to other.Greater than zero This instance is greater than other.
CompareTo(object)
Compares the current instance with another object of the same type.
public int CompareTo(object obj)
Parameters
objobjectAn 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:
Value Meaning Less than zero This instance is less than obj.Zero This instance is equal to obj.Greater than zero This 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
otherReportLevelAnother object.
Returns
- bool
Trueif the current object is equal to theotherparameter; otherwisefalse.
Equals(object)
Determines whether the specified object is equal to the current instance.
public override bool Equals(object obj)
Parameters
objobjectAnother object.
Returns
- bool
Trueif the specified object is equal to the current instance; otherwisefalse.
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
reportLevelReportLevelA report level.
Returns
- bool
trueif 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
reportLevelStringstringA string representing a report level.
Returns
- ReportLevel
A new ReportLevel corresponding to
reportLevelString.
Exceptions
- ArgumentNullException
If
reportLevelStringisnull.- FormatException
If
reportLevelStringhas 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
formatProviderIFormatProviderThe IFormatProvider to use or
nullto 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
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
formatstringThe string specifying the format to use or
nullto use the default format.formatProviderIFormatProviderThe IFormatProvider to use or
nullto 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 String | Description and Associated Properties |
|---|---|
| g | General format. Returns the Name of the report level. |
| h | Human readable format. "g" format is used if this instance is one of the StandardValues; otherwise "r" format is used. |
| r | Round-trip (serialization) format. Returns a string representation containing all the information to create the instance again using the Parse(string) method. |
| d | Decimal format. Returns the Level in decimal form. See ToString(string, IFormatProvider) for more info. |
| x | Hexadecimal 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
reportLevelStringstringA string representing a report level.
reportLevelReportLevelWhen this method returns, contains a ReportLevel instance if parsing succeeded,
nullotherwise.
Returns
- bool
Trueif parsing succeeded, otherwisefalse.
Operators
operator ==(ReportLevel, ReportLevel)
Implements the operator ==.
public static bool operator ==(ReportLevel r1, ReportLevel r2)
Parameters
r1ReportLevelThe r1.
r2ReportLevelThe r2.
Returns
- bool
Returns whether
r1andr2are equal.
operator >(ReportLevel, ReportLevel)
Implements the operator >.
public static bool operator >(ReportLevel r1, ReportLevel r2)
Parameters
r1ReportLevelThe r1.
r2ReportLevelThe r2.
Returns
- bool
Returns whether
r1is greater thanr2.
operator >=(ReportLevel, ReportLevel)
Implements the operator >=.
public static bool operator >=(ReportLevel r1, ReportLevel r2)
Parameters
r1ReportLevelThe r1.
r2ReportLevelThe r2.
Returns
- bool
Returns whether
r1is greater than or equal tor2.
operator !=(ReportLevel, ReportLevel)
Implements the operator !=.
public static bool operator !=(ReportLevel r1, ReportLevel r2)
Parameters
r1ReportLevelThe r1.
r2ReportLevelThe r2.
Returns
- bool
Returns whether
r1andr2are not equal.
operator <(ReportLevel, ReportLevel)
Implements the operator <.
public static bool operator <(ReportLevel r1, ReportLevel r2)
Parameters
r1ReportLevelThe r1.
r2ReportLevelThe r2.
Returns
- bool
Returns whether
r1is less thanr2.
operator <=(ReportLevel, ReportLevel)
Implements the operator <=.
public static bool operator <=(ReportLevel r1, ReportLevel r2)
Parameters
r1ReportLevelThe r1.
r2ReportLevelThe r2.
Returns
- bool
Returns whether
r1is less than or equal tor2.