Click or drag to resize
Ranorex

Duration Class

Represents a span of time.
Inheritance Hierarchy
SystemObject
  RanorexDuration

Namespace:  Ranorex
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
[SerializableAttribute]
[TypeConverterAttribute(typeof(DurationDurationConverter))]
public sealed class Duration : IFormattable, 
	IComparable<Duration>, IComparable, IEquatable<Duration>

The Duration type exposes the following members.

Constructors
  NameDescription
Public methodDuration
Constructs a new instance and initializes it with the value of Zero.
Public methodDuration(Int32)
Constructs a new instance and initializes it with the given number of milliseconds.
Public methodDuration(TimeSpan)
Constructs a new instance and initializes it with the value of the given TimeSpan.
Top
Properties
  NameDescription
Public propertyMilliseconds
Gets the number of milliseconds this instance represents.
Public propertyTimeSpan
Gets a TimeSpan representation of this instance.
Top
Methods
  NameDescription
Public methodStatic memberCompare
Compares two Duration objects and returns an indication of their relative values.
Public methodCompareTo(Object)
Compares the current duration with another object of the same type.
Public methodCompareTo(Duration)
Compares the current duration with another duration object.
Public methodStatic memberCopy
Returns a copy of the specified duration.
Public methodEquals(Object)
Returns true if the two objects are equal.
(Overrides ObjectEquals(Object).)
Public methodEquals(Duration)
Indicates whether the current Duration is equal to another Duration.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberFromMilliseconds
Returns a new Duration instance initialized by the milliseconds value.
Public methodStatic memberFromTimeSpan
Returns a new Duration instance initialized by the TimeSpan value.
Public methodGetHashCode
Gets a hash code for this instance.
(Overrides ObjectGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberParse
Parses the given String and returns a new Duration instance.
Public methodStatic memberToMilliseconds
Returns the number of milliseconds represented by the Duration instance.
Public methodToString
Returns a string representation of this instance.
(Overrides ObjectToString.)
Public methodToString(String)
Returns a string representation of this instance.
Public methodToString(String, IFormatProvider)
Returns a string representation of this instance.
Public methodStatic memberToTimeSpan
Returns a TimeSpan value corresponding to the Duration instance.
Public methodStatic memberTryParse
Tries parsing the given String to a Duration instance.
Top
Operators
  NameDescription
Public operatorStatic memberAddition(Int32, Duration)
Adds two values.
Public operatorStatic memberAddition(TimeSpan, Duration)
Adds two values.
Public operatorStatic memberAddition(Duration, Duration)
Adds two values.
Public operatorStatic memberAddition(Duration, Int32)
Adds two values.
Public operatorStatic memberAddition(Duration, TimeSpan)
Adds two values.
Public operatorStatic memberEquality
Returns true if the two Duration instances are equal.
Public operatorStatic memberGreaterThan(Int32, Duration)
Returns whether left is greater than right.
Public operatorStatic memberGreaterThan(TimeSpan, Duration)
Returns whether left is greater than right.
Public operatorStatic memberGreaterThan(Duration, Duration)
Returns whether left is greater than right.
Public operatorStatic memberGreaterThan(Duration, Int32)
Returns whether left is greater than right.
Public operatorStatic memberGreaterThan(Duration, TimeSpan)
Returns whether left is greater than right.
Public operatorStatic memberGreaterThanOrEqual(Int32, Duration)
Returns whether left is greater than or equal to right.
Public operatorStatic memberGreaterThanOrEqual(TimeSpan, Duration)
Returns whether left is greater than or equal to right.
Public operatorStatic memberGreaterThanOrEqual(Duration, Duration)
Returns whether left is greater than or equal to right.
Public operatorStatic memberGreaterThanOrEqual(Duration, Int32)
Returns whether left is greater than or equal to right.
Public operatorStatic memberGreaterThanOrEqual(Duration, TimeSpan)
Returns whether left is greater than or equal to right.
Public operatorStatic member(Int32 to Duration)
Returns a new Duration instance initialized by the milliseconds value.
Public operatorStatic member(TimeSpan to Duration)
Returns a new Duration instance initialized by the TimeSpan value.
Public operatorStatic member(Duration to Int32)
Returns the number of milliseconds represented by the Duration instance.
Public operatorStatic member(Duration to TimeSpan)
Returns a TimeSpan value corresponding to the Duration instance.
Public operatorStatic memberInequality
Returns true if the two Duration instances are not equal.
Public operatorStatic memberLessThan(Int32, Duration)
Returns whether left is less than right.
Public operatorStatic memberLessThan(TimeSpan, Duration)
Returns whether left is less than right.
Public operatorStatic memberLessThan(Duration, Duration)
Returns whether left is less than right.
Public operatorStatic memberLessThan(Duration, Int32)
Returns whether left is less than right.
Public operatorStatic memberLessThan(Duration, TimeSpan)
Returns whether left is less than right.
Public operatorStatic memberLessThanOrEqual(Int32, Duration)
Returns whether left is less than or equal to right.
Public operatorStatic memberLessThanOrEqual(TimeSpan, Duration)
Returns whether left is less than or equal to right.
Public operatorStatic memberLessThanOrEqual(Duration, Duration)
Returns whether left is less than or equal to right.
Public operatorStatic memberLessThanOrEqual(Duration, Int32)
Returns whether left is less than or equal to right.
Public operatorStatic memberLessThanOrEqual(Duration, TimeSpan)
Returns whether left is less than or equal to right.
Public operatorStatic memberMultiply
Multiplies a duration by the specified factor.
Public operatorStatic memberSubtraction(Int32, Duration)
Subtracts two values.
Public operatorStatic memberSubtraction(TimeSpan, Duration)
Subtracts two values.
Public operatorStatic memberSubtraction(Duration, Duration)
Subtracts two values.
Public operatorStatic memberSubtraction(Duration, Int32)
Subtracts two values.
Public operatorStatic memberSubtraction(Duration, TimeSpan)
Subtracts two values.
Top
Fields
  NameDescription
Public fieldStatic memberMaxValue
Represents the maximum Duration value. This field is read-only.
Public fieldStatic memberMinValue
Represents the minimum Duration value. This field is read-only.
Public fieldStatic memberZero
Represents the zero Duration value. This field is read-only.
Top
Remarks
This class facilitates creating objects that represent a span of time by providing initializers that take an Int32 (regarded as milliseconds) or a TimeSpan.
See Also