TXT

timespan2

By Jean Palmer,2014-10-21 20:10
8 views 0
timespan2

using System.Runtime.InteropServices;

namespace System

    {

     // ÕªÒª:

     // Represents a time interval.

     [Serializable]

     [ComVisible(true)]

     public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>

     {

     // ÕªÒª:

     // Represents the number of ticks in 1 day. This field is constant.

     public const long TicksPerDay = 864000000000;

     //

     // ÕªÒª:

     // Represents the number of ticks in 1 hour. This field is constant.

     public const long TicksPerHour = 36000000000;

     //

     // ÕªÒª:

     // Represents the number of ticks in 1 millisecond. This field

    is constant.

     public const long TicksPerMillisecond = 10000;

     //

     // ÕªÒª:

     // Represents the number of ticks in 1 minute. This field is constant.

     public const long TicksPerMinute = 600000000;

     //

     // ÕªÒª:

     // Represents the number of ticks in 1 second.

     public const long TicksPerSecond = 10000000;

     // ÕªÒª:

     // Represents the maximum System.TimeSpan value. This field is read-only.

     public static readonly TimeSpan MaxValue;

     //

     // ÕªÒª:

     // Represents the minimum System.TimeSpan value. This field is read-only.

     public static readonly TimeSpan MinValue;

     //

     // ÕªÒª:

     // Represents the zero System.TimeSpan value. This field is

    read-only.

     public static readonly TimeSpan Zero;

     //

     // ÕªÒª:

     // Initializes a new System.TimeSpan to the specified number

    of ticks.

     //

     // ?ÎÊý:

     // ticks:

     // A time period expressed in 100-nanosecond units.

     public TimeSpan(long ticks);

     //

     // ÕªÒª:

     // Initializes a new System.TimeSpan to a specified number of hours, minutes,

     // and seconds.

     //

     // ?ÎÊý:

     // hours:

     // Number of hours.

     //

     // minutes:

     // Number of minutes.

     //

     // seconds:

     // Number of seconds.

     //

     // Òì??:

     // System.ArgumentOutOfRangeException:

     // The parameters specify a System.TimeSpan value less than

    System.TimeSpan.MinValue

     // or greater than System.TimeSpan.MaxValue.

     public TimeSpan(int hours, int minutes, int seconds);

     //

     // ÕªÒª:

     // Initializes a new System.TimeSpan to a specified number of days, hours, minutes,

     // and seconds.

     //

     // ?ÎÊý:

     // days:

     // Number of days.

     //

     // hours:

     // Number of hours.

     //

     // minutes:

     // Number of minutes.

     //

     // seconds:

     // Number of seconds.

     //

     // Òì??:

     // System.ArgumentOutOfRangeException:

     // The parameters specify a System.TimeSpan value less than

    System.TimeSpan.MinValue

     // or greater than System.TimeSpan.MaxValue.

     public TimeSpan(int days, int hours, int minutes, int seconds);

     //

     // ÕªÒª:

     // Initializes a new System.TimeSpan to a specified number

    of days, hours, minutes,

     // seconds, and milliseconds.

     //

     // ?ÎÊý:

     // days:

     // Number of days.

     //

     // hours:

     // Number of hours.

     //

     // minutes:

     // Number of minutes.

     //

     // seconds:

     // Number of seconds.

     //

     // milliseconds:

     // Number of milliseconds.

     //

     // Òì??:

     // System.ArgumentOutOfRangeException:

     // The parameters specify a System.TimeSpan value less than

    System.TimeSpan.MinValue

     // or greater than System.TimeSpan.MaxValue.

     public TimeSpan(int days, int hours, int minutes, int seconds,

    int milliseconds);

     // ÕªÒª:

     // Returns a System.TimeSpan whose value is the negated value

    of the specified

     // instance.

     //

     // ?ÎÊý:

     // t:

     // A System.TimeSpan.

     //

     // ?µ?Ø?á?û:

     // A System.TimeSpan with the same numeric value as this

    instance, but the opposite

     // sign.

     //

     // Òì??:

     // System.OverflowException:

     // The negated value of this instance cannot be represented

    by a System.TimeSpan;

     // that is, the value of this instance is System.TimeSpan.MinValue.

     public static TimeSpan operator -(TimeSpan t);

     //

     // ÕªÒª:

     // Subtracts a specified System.TimeSpan from another specified System.TimeSpan.

     //

     // ?ÎÊý:

     // t1:

     // A System.TimeSpan.

     //

     // t2:

     // A TimeSpan.

     //

     // ?µ?Ø?á?û:

     // A TimeSpan whose value is the result of the value of t1

    minus the value of

     // t2.

     //

     // Òì??:

     // System.OverflowException:

     // The return value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.

     public static TimeSpan operator -(TimeSpan t1, TimeSpan t2);

     //

     // ÕªÒª:

     // Indicates whether two System.TimeSpan instances are not equal.

     //

     // ?ÎÊý:

     // t1:

     // A System.TimeSpan.

     //

     // t2:

     // A TimeSpan.

     //

     // ?µ?Ø?á?û:

     // true if the values of t1 and t2 are not equal; otherwise, false.

     public static bool operator !=(TimeSpan t1, TimeSpan t2);

     //

     // ÕªÒª:

     // Returns the specified instance of System.TimeSpan.

     //

     // ?ÎÊý:

     // t:

     // A System.TimeSpan.

     //

     // ?µ?Ø?á?û:

     // Returns t.

     public static TimeSpan operator +(TimeSpan t);

     //

     // ÕªÒª:

     // Adds two specified System.TimeSpan instances.

     //

     // ?ÎÊý:

     // t1:

     // A System.TimeSpan.

     //

     // t2:

     // A TimeSpan.

     //

     // ?µ?Ø?á?û:

     // A System.TimeSpan whose value is the sum of the values of t1 and t2.

     //

     // Òì??:

     // System.OverflowException:

     // The resulting System.TimeSpan is less than System.TimeSpan.MinValue or greater

     // than System.TimeSpan.MaxValue.

     public static TimeSpan operator +(TimeSpan t1, TimeSpan t2);

     //

     // ÕªÒª:

     // Indicates whether a specified System.TimeSpan is less than another specified

     // System.TimeSpan.

     //

     // ?ÎÊý:

     // t1:

     // A System.TimeSpan.

     //

     // t2:

     // A TimeSpan.

     //

     // ?µ?Ø?á?û:

     // true if the value of t1 is less than the value of t2; otherwise, false.

     public static bool operator <(TimeSpan t1, TimeSpan t2);

     //

     // ÕªÒª:

     // Indicates whether a specified System.TimeSpan is less than or equal to another

     // specified System.TimeSpan.

     //

     // ?ÎÊý:

     // t1:

     // A System.TimeSpan.

     //

     // t2:

     // A TimeSpan.

     //

     // ?µ?Ø?á?û:

     // true if the value of t1 is less than or equal to the value

    of t2; otherwise,

     // false.

     public static bool operator <=(TimeSpan t1, TimeSpan t2);

     //

     // ÕªÒª:

     // Indicates whether two System.TimeSpan instances are

    equal.

     //

     // ?ÎÊý:

     // t1:

     // A System.TimeSpan.

     //

     // t2:

     // A TimeSpan.

     //

     // ?µ?Ø?á?û:

     // true if the values of t1 and t2 are equal; otherwise, false.

     public static bool operator ==(TimeSpan t1, TimeSpan t2);

     //

     // ÕªÒª:

     // Indicates whether a specified System.TimeSpan is greater

    than another specified

     // System.TimeSpan.

     //

     // ?ÎÊý:

     // t1:

     // A System.TimeSpan.

     //

     // t2:

     // A TimeSpan.

     //

     // ?µ?Ø?á?û:

     // true if the value of t1 is greater than the value of t2;

    otherwise, false.

     public static bool operator >(TimeSpan t1, TimeSpan t2);

     //

     // ÕªÒª:

     // Indicates whether a specified System.TimeSpan is greater

    than or equal to

     // another specified System.TimeSpan.

     //

     // ?ÎÊý:

     // t1:

     // A System.TimeSpan.

     //

     // t2:

     // A TimeSpan.

     //

     // ?µ?Ø?á?û:

     // true if the value of t1 is greater than or equal to the value of t2; otherwise,

     // false.

     public static bool operator >=(TimeSpan t1, TimeSpan t2);

     // ÕªÒª:

     // Gets the days component of the time interval represented by the current System.TimeSpan

     // structure.

     //

     // ?µ?Ø?á?û:

     // The day component of this instance. The return value can be positive or negative.

     public int Days { get; }

     //

     // ÕªÒª:

     // Gets the hours component of the time interval represented by the current

     // System.TimeSpan structure.

     //

     // ?µ?Ø?á?û:

     // The hour component of the current System.TimeSpan structure. The return value

     // ranges from -23 through 23.

     public int Hours { get; }

     //

     // ÕªÒª:

     // Gets the milliseconds component of the time interval represented by the current

     // System.TimeSpan structure.

     //

     // ?µ?Ø?á?û:

     // The millisecond component of the current System.TimeSpan structure. The return

     // value ranges from -999 through 999.

     public int Milliseconds { get; }

     //

     // ÕªÒª:

     // Gets the minutes component of the time interval represented by the current

     // System.TimeSpan structure.

     //

     // ?µ?Ø?á?û:

     // The minute component of the current System.TimeSpan

structure. The return

     // value ranges from -59 through 59.

     public int Minutes { get; }

     //

     // ÕªÒª:

     // Gets the seconds component of the time interval represented by the current

     // System.TimeSpan structure.

     //

     // ?µ?Ø?á?û:

     // The second component of the current System.TimeSpan structure. The return

     // value ranges from -59 through 59.

     public int Seconds { get; }

     //

     // ÕªÒª:

     // Gets the number of ticks that represent the value of the current System.TimeSpan

     // structure.

     //

     // ?µ?Ø?á?û:

     // The number of ticks contained in this instance.

     public long Ticks { get; }

     //

     // ÕªÒª:

     // Gets the value of the current System.TimeSpan structure expressed in whole

     // and fractional days.

     //

     // ?µ?Ø?á?û:

     // The total number of days represented by this instance.

     public double TotalDays { get; }

     //

     // ÕªÒª:

     // Gets the value of the current System.TimeSpan structure expressed in whole

     // and fractional hours.

     //

     // ?µ?Ø?á?û:

     // The total number of hours represented by this instance.

     public double TotalHours { get; }

     //

     // ÕªÒª:

     // Gets the value of the current System.TimeSpan structure

expressed in whole

     // and fractional milliseconds.

     //

     // ?µ?Ø?á?û:

     // The total number of milliseconds represented by this instance.

     public double TotalMilliseconds { get; }

     //

     // ÕªÒª:

     // Gets the value of the current System.TimeSpan structure expressed in whole

     // and fractional minutes.

     //

     // ?µ?Ø?á?û:

     // The total number of minutes represented by this instance.

     public double TotalMinutes { get; }

     //

     // ÕªÒª:

     // Gets the value of the current System.TimeSpan structure expressed in whole

     // and fractional seconds.

     //

     // ?µ?Ø?á?û:

     // The total number of seconds represented by this instance.

     public double TotalSeconds { get; }

     // ÕªÒª:

     // Adds the specified System.TimeSpan to this instance.

     //

     // ?ÎÊý:

     // ts:

     // A System.TimeSpan.

     //

     // ?µ?Ø?á?û:

     // A System.TimeSpan that represents the value of this instance plus the value

     // of ts.

     //

     // Òì??:

     // System.OverflowException:

     // The resulting System.TimeSpan is less than System.TimeSpan.MinValue or greater

     // than System.TimeSpan.MaxValue.

     public TimeSpan Add(TimeSpan ts);

Report this document

For any questions or suggestions please email
cust-service@docsford.com