| Duration Structure | 
Namespace: AGI.Foundation.Time
 Syntax
SyntaxThe Duration type exposes the following members.
 Constructors
Constructors| Name | Description | |
|---|---|---|
|  | Duration(TimeSpan) | 
            Initializes a new Duration from a TimeSpan.
            The time standard is not specified, so this Duration will match the
            time standard of anything it is added to or subtracted from.
             | 
|  | Duration(Int32, Double) | 
            Initializes a new instance of Duration from a specified number
            of days and seconds.  The time standard is not specified, so this Duration
            will match the time standard of anything it is added to or subtracted from.
             | 
|  | Duration(TimeSpan, TimeStandard) | 
            Initializes a new Duration from a TimeSpan.
            It also specifies that the time is measured using the specified
            time standard.
             | 
|  | Duration(Int32, Double, TimeStandard) | 
            Initializes a new instance of Duration from a specified number
            of days and seconds.  It also specifies that the time is
            measured using the specified time standard.
             | 
|  | Duration(Int32, Int32, Int32, Double) | 
            Initializes a new instance of Duration from a specified number
            of days, hours, minutes, and seconds.  The time standard is not
            specified, so this Duration will match the time standard of anything it
            is added to or subtracted from.
             | 
|  | Duration(Int32, Int32, Int32, Double, TimeStandard) | 
            Initializes a new instance of Duration from a specified number
            of days, hours, minutes, and seconds.  It also specifies that the time is
            measured using the specified time standard.
             | 
 Properties
Properties| Name | Description | |
|---|---|---|
|  | Days | 
            Gets the day component of this Duration.
             | 
|   | MaxValue | 
            Gets the largest possible value of a Duration.
             | 
|   | MinValue | 
            Gets the smallest possible value of a Duration.
             | 
|  | Seconds | 
            Gets the seconds component of this Duration.  This is the number of seconds represented by
            this Duration in addition to the Days, so it will always be less than
            SecondsPerDay.
             | 
|  | Standard | 
            Gets the time standard in which this Duration is measured.
             | 
|  | TotalDays | 
            Gets the total number of whole and fractional days represented by this Duration.
             | 
|  | TotalSeconds | 
            Gets the total number of seconds represented by this Duration, including the seconds
            that compose the days returned by the Days property.
             | 
|   | Zero | 
            Gets a Duration of 0 days and seconds.
             | 
 Methods
Methods| Name | Description | |
|---|---|---|
|  | Add | 
            Adds the specified Duration to this instance.
             | 
|  | AddDays | 
            Adds a specified number of days to this Duration and returns the new Duration.
             | 
|  | AddSeconds | 
            Adds a specified number of seconds to this Duration and returns the new Duration.
             | 
|  | CompareTo(Duration) | 
        Compares this instance with another instance of the same type.
       | 
|  | CompareTo(Object) | 
        Compares this instance with another instance of the same type.
       | 
|  | Divide(Double) | 
            Divides the Duration by a constant.
             | 
|  | Divide(Duration) | 
            Divides the Duration by another Duration, yield a constant.
             | 
|  | Equals(Duration) | |
|  | Equals(Object) | 
            Returns  if this Duration exactly equals another Duration, within the limits
            of floating point precision.  To be considered equal, the Days
            and Standard properties must be identical (or one must be null) and the
            difference between the Seconds properties must be less than 1.0e-10.
            (Overrides ValueTypeEquals(Object).) | 
|  | EqualsEpsilon | 
            Returns  if this Duration is within epsilon seconds of the
            specified Duration.  That is, in order for the Durations to be considered equal (and for
            this function to return ), the absolute value of the difference between them, in
            seconds, must be less than or equal to epsilon.
             | 
|   | FromDays(Double) | 
            Returns a Duration that represents the specified number of days.
             | 
|   | FromDays(Double, TimeStandard) | 
            Returns a Duration that represents the specified number of days
            using the specified time standard.
             | 
|   | FromHours(Double) | 
            Returns a Duration that represents the specified number of hours.
             | 
|   | FromHours(Double, TimeStandard) | 
            Returns a Duration that represents the specified number of hours using the
            specified time standard.
             | 
|   | FromMinutes(Double) | 
            Returns a Duration that represents the specified number of minutes.
             | 
|   | FromMinutes(Double, TimeStandard) | 
            Returns a Duration that represents the specified number of minutes using the
            specified time standard.
             | 
|   | FromSeconds(Double) | 
            Returns a Duration that represents the specified number of seconds.
             | 
|   | FromSeconds(Double, TimeStandard) | 
            Returns a Duration that represents the specified number of seconds using the
            specified time standard.
             | 
|  | GetHashCode | 
        Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
      (Overrides ValueTypeGetHashCode.) | 
|  | GetType | Gets the Type of the current instance.(Inherited from Object.) | 
|   | HoursMinutesSecondsToSeconds | 
            Converts the specified number of hours, minutes, and seconds to total duration in seconds.
             | 
|  | Multiply | 
            Multiplies the Duration by a constant.
             | 
|  | Subtract | 
            Subtracts the specified Duration from this instance.
             | 
|  | ToString | (Overrides ValueTypeToString.) | 
|  | ToTimeSpan | 
            Returns a TimeSpan equivalent to this Duration.
             | 
 Operators
Operators| Name | Description | |
|---|---|---|
|   | Addition | 
            Adds two specified Duration instances.
             | 
|   | Division(Duration, Duration) | 
            Divides the Duration by another duration.
             | 
|   | Division(Duration, Double) | 
            Divides the Duration by a constant.
             | 
|   | Equality | |
|   | GreaterThan | 
            Returns  if left is longer than right.
             | 
|   | GreaterThanOrEqual | 
            Returns  if left is longer than or exactly equal to right.
             | 
|   | Inequality | |
|   | LessThan | 
            Returns  if left is shorter than right.
             | 
|   | LessThanOrEqual | 
            Returns  if left is shorter than or exactly equal to right.
             | 
|   | Multiply | 
            Multiplies the Duration by a constant.
             | 
|   | Subtraction | 
            Subtracts a specified Duration from another specified Duration.
             | 
|   | UnaryNegation | 
            Inverts a specified Duration.  For example, if the value represents a positive
            quantity of time, the returned Duration will be a negative quantity of time.
             | 
 See Also
See Also