using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; namespace System { /// Represents a time interval. /// 1 // Token: 0x020006AF RID: 1711 [ComVisible(true)] [Serializable] public struct TimeSpan : IComparable, IComparable, IEquatable { /// Initializes a new to the specified number of ticks. /// A time period expressed in 100-nanosecond units. // Token: 0x060040A6 RID: 16550 RVA: 0x000DC15C File Offset: 0x000DA35C public TimeSpan(long ticks) { this._ticks = ticks; } /// Initializes a new to a specified number of hours, minutes, and seconds. /// Number of hours. /// Number of minutes. /// Number of seconds. /// The parameters specify a value less than or greater than . // Token: 0x060040A7 RID: 16551 RVA: 0x000DC168 File Offset: 0x000DA368 public TimeSpan(int hours, int minutes, int seconds) { this._ticks = TimeSpan.CalculateTicks(0, hours, minutes, seconds, 0); } /// Initializes a new to a specified number of days, hours, minutes, and seconds. /// Number of days. /// Number of hours. /// Number of minutes. /// Number of seconds. /// The parameters specify a value less than or greater than . // Token: 0x060040A8 RID: 16552 RVA: 0x000DC17C File Offset: 0x000DA37C public TimeSpan(int days, int hours, int minutes, int seconds) { this._ticks = TimeSpan.CalculateTicks(days, hours, minutes, seconds, 0); } /// Initializes a new to a specified number of days, hours, minutes, seconds, and milliseconds. /// Number of days. /// Number of hours. /// Number of minutes. /// Number of seconds. /// Number of milliseconds. /// The parameters specify a value less than or greater than . // Token: 0x060040A9 RID: 16553 RVA: 0x000DC190 File Offset: 0x000DA390 public TimeSpan(int days, int hours, int minutes, int seconds, int milliseconds) { this._ticks = TimeSpan.CalculateTicks(days, hours, minutes, seconds, milliseconds); } // Token: 0x060040AA RID: 16554 RVA: 0x000DC1A4 File Offset: 0x000DA3A4 static TimeSpan() { if (MonoTouchAOTHelper.FalseFlag) { GenericComparer genericComparer = new GenericComparer(); GenericEqualityComparer genericEqualityComparer = new GenericEqualityComparer(); } } // Token: 0x060040AB RID: 16555 RVA: 0x000DC1FC File Offset: 0x000DA3FC internal static long CalculateTicks(int days, int hours, int minutes, int seconds, int milliseconds) { int num = hours * 3600; int num2 = minutes * 60; long num3 = (long)(num + num2 + seconds) * 1000L + (long)milliseconds; num3 *= 10000L; bool flag = false; if (days > 0) { long num4 = 864000000000L * (long)days; if (num3 < 0L) { long num5 = num3; num3 += num4; flag = num5 > num3; } else { num3 += num4; flag = num3 < 0L; } } else if (days < 0) { long num6 = 864000000000L * (long)days; if (num3 <= 0L) { num3 += num6; flag = num3 > 0L; } else { long num7 = num3; num3 += num6; flag = num3 > num7; } } if (flag) { throw new ArgumentOutOfRangeException(Locale.GetText("The timespan is too big or too small.")); } return num3; } /// Gets the days component of the time interval represented by the current structure. /// The day component of this instance. The return value can be positive or negative. /// 1 // Token: 0x17000BEE RID: 3054 // (get) Token: 0x060040AC RID: 16556 RVA: 0x000DC2C8 File Offset: 0x000DA4C8 public int Days { get { return (int)(this._ticks / 864000000000L); } } /// Gets the hours component of the time interval represented by the current structure. /// The hour component of the current structure. The return value ranges from -23 through 23. /// 1 // Token: 0x17000BEF RID: 3055 // (get) Token: 0x060040AD RID: 16557 RVA: 0x000DC2DC File Offset: 0x000DA4DC public int Hours { get { return (int)(this._ticks % 864000000000L / 36000000000L); } } /// Gets the milliseconds component of the time interval represented by the current structure. /// The millisecond component of the current structure. The return value ranges from -999 through 999. /// 1 // Token: 0x17000BF0 RID: 3056 // (get) Token: 0x060040AE RID: 16558 RVA: 0x000DC2FC File Offset: 0x000DA4FC public int Milliseconds { get { return (int)(this._ticks % 10000000L / 10000L); } } /// Gets the minutes component of the time interval represented by the current structure. /// The minute component of the current structure. The return value ranges from -59 through 59. /// 1 // Token: 0x17000BF1 RID: 3057 // (get) Token: 0x060040AF RID: 16559 RVA: 0x000DC314 File Offset: 0x000DA514 public int Minutes { get { return (int)(this._ticks % 36000000000L / 600000000L); } } /// Gets the seconds component of the time interval represented by the current structure. /// The second component of the current structure. The return value ranges from -59 through 59. /// 1 // Token: 0x17000BF2 RID: 3058 // (get) Token: 0x060040B0 RID: 16560 RVA: 0x000DC330 File Offset: 0x000DA530 public int Seconds { get { return (int)(this._ticks % 600000000L / 10000000L); } } /// Gets the number of ticks that represent the value of the current structure. /// The number of ticks contained in this instance. /// 1 // Token: 0x17000BF3 RID: 3059 // (get) Token: 0x060040B1 RID: 16561 RVA: 0x000DC348 File Offset: 0x000DA548 public long Ticks { get { return this._ticks; } } /// Gets the value of the current structure expressed in whole and fractional days. /// The total number of days represented by this instance. /// 1 // Token: 0x17000BF4 RID: 3060 // (get) Token: 0x060040B2 RID: 16562 RVA: 0x000DC350 File Offset: 0x000DA550 public double TotalDays { get { return (double)this._ticks / 864000000000.0; } } /// Gets the value of the current structure expressed in whole and fractional hours. /// The total number of hours represented by this instance. /// 1 // Token: 0x17000BF5 RID: 3061 // (get) Token: 0x060040B3 RID: 16563 RVA: 0x000DC364 File Offset: 0x000DA564 public double TotalHours { get { return (double)this._ticks / 36000000000.0; } } /// Gets the value of the current structure expressed in whole and fractional milliseconds. /// The total number of milliseconds represented by this instance. /// 1 // Token: 0x17000BF6 RID: 3062 // (get) Token: 0x060040B4 RID: 16564 RVA: 0x000DC378 File Offset: 0x000DA578 public double TotalMilliseconds { get { return (double)this._ticks / 10000.0; } } /// Gets the value of the current structure expressed in whole and fractional minutes. /// The total number of minutes represented by this instance. /// 1 // Token: 0x17000BF7 RID: 3063 // (get) Token: 0x060040B5 RID: 16565 RVA: 0x000DC38C File Offset: 0x000DA58C public double TotalMinutes { get { return (double)this._ticks / 600000000.0; } } /// Gets the value of the current structure expressed in whole and fractional seconds. /// The total number of seconds represented by this instance. /// 1 // Token: 0x17000BF8 RID: 3064 // (get) Token: 0x060040B6 RID: 16566 RVA: 0x000DC3A0 File Offset: 0x000DA5A0 public double TotalSeconds { get { return (double)this._ticks / 10000000.0; } } /// Returns a new object whose value is the sum of the specified object and this instance. /// A new object that represents the value of this instance plus the value of . /// A . /// The resulting is less than or greater than . /// 1 // Token: 0x060040B7 RID: 16567 RVA: 0x000DC3B4 File Offset: 0x000DA5B4 public TimeSpan Add(TimeSpan ts) { TimeSpan timeSpan; try { timeSpan = new TimeSpan(checked(this._ticks + ts.Ticks)); } catch (OverflowException) { throw new OverflowException(Locale.GetText("Resulting timespan is too big.")); } return timeSpan; } /// Compares two values and returns an integer that indicates whether the first value is shorter than, equal to, or longer than the second value. /// Value Condition -1 is shorter than 0 is equal to 1 is longer than /// A . /// A . /// 1 // Token: 0x060040B8 RID: 16568 RVA: 0x000DC414 File Offset: 0x000DA614 public static int Compare(TimeSpan t1, TimeSpan t2) { if (t1._ticks < t2._ticks) { return -1; } if (t1._ticks > t2._ticks) { return 1; } return 0; } /// Compares this instance to a specified object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the specified object. /// Value Condition -1 This instance is shorter than . 0 This instance is equal to . 1 This instance is longer than .-or- is null. /// An object to compare, or null. /// /// is not a . /// 1 // Token: 0x060040B9 RID: 16569 RVA: 0x000DC444 File Offset: 0x000DA644 public int CompareTo(object value) { if (value == null) { return 1; } if (!(value is TimeSpan)) { throw new ArgumentException(Locale.GetText("Argument has to be a TimeSpan."), "value"); } return TimeSpan.Compare(this, (TimeSpan)value); } /// Compares this instance to a specified object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the object. /// A signed number indicating the relative values of this instance and .Value Description A negative integer This instance is shorter than . Zero This instance is equal to . A positive integer This instance is longer than . /// A object to compare to this instance. /// 1 // Token: 0x060040BA RID: 16570 RVA: 0x000DC480 File Offset: 0x000DA680 public int CompareTo(TimeSpan value) { return TimeSpan.Compare(this, value); } /// Returns a value indicating whether this instance is equal to a specified object. /// true if represents the same time interval as this instance; otherwise, false. /// An object to compare with this instance. /// 1 // Token: 0x060040BB RID: 16571 RVA: 0x000DC490 File Offset: 0x000DA690 public bool Equals(TimeSpan obj) { return obj._ticks == this._ticks; } /// Returns a new object whose value is the absolute value of the current object. /// A new object whose value is the absolute value of the current object. /// The value of this instance is . /// 1 // Token: 0x060040BC RID: 16572 RVA: 0x000DC4A4 File Offset: 0x000DA6A4 public TimeSpan Duration() { TimeSpan timeSpan; try { timeSpan = new TimeSpan(Math.Abs(this._ticks)); } catch (OverflowException) { throw new OverflowException(Locale.GetText("This TimeSpan value is MinValue so you cannot get the duration.")); } return timeSpan; } /// Returns a value indicating whether this instance is equal to a specified object. /// true if is a object that represents the same time interval as the current structure; otherwise, false. /// An object to compare with this instance. /// 1 // Token: 0x060040BD RID: 16573 RVA: 0x000DC500 File Offset: 0x000DA700 public override bool Equals(object value) { return value is TimeSpan && this._ticks == ((TimeSpan)value)._ticks; } /// Returns a value indicating whether two specified instances of are equal. /// true if the values of and are equal; otherwise, false. /// A . /// A TimeSpan. /// 1 // Token: 0x060040BE RID: 16574 RVA: 0x000DC530 File Offset: 0x000DA730 public static bool Equals(TimeSpan t1, TimeSpan t2) { return t1._ticks == t2._ticks; } /// Returns a that represents a specified number of days, where the specification is accurate to the nearest millisecond. /// A that represents . /// A number of days, accurate to the nearest millisecond. /// /// is less than or greater than . -or- is .-or- is . /// /// is equal to . /// 1 // Token: 0x060040BF RID: 16575 RVA: 0x000DC544 File Offset: 0x000DA744 public static TimeSpan FromDays(double value) { return TimeSpan.From(value, 864000000000L); } /// Returns a that represents a specified number of hours, where the specification is accurate to the nearest millisecond. /// A that represents . /// A number of hours accurate to the nearest millisecond. /// /// is less than or greater than . -or- is .-or- is . /// /// is equal to . /// 1 // Token: 0x060040C0 RID: 16576 RVA: 0x000DC558 File Offset: 0x000DA758 public static TimeSpan FromHours(double value) { return TimeSpan.From(value, 36000000000L); } /// Returns a that represents a specified number of minutes, where the specification is accurate to the nearest millisecond. /// A that represents . /// A number of minutes, accurate to the nearest millisecond. /// /// is less than or greater than .-or- is .-or- is . /// /// is equal to . /// 1 // Token: 0x060040C1 RID: 16577 RVA: 0x000DC56C File Offset: 0x000DA76C public static TimeSpan FromMinutes(double value) { return TimeSpan.From(value, 600000000L); } /// Returns a that represents a specified number of seconds, where the specification is accurate to the nearest millisecond. /// A that represents . /// A number of seconds, accurate to the nearest millisecond. /// /// is less than or greater than .-or- is .-or- is . /// /// is equal to . /// 1 // Token: 0x060040C2 RID: 16578 RVA: 0x000DC57C File Offset: 0x000DA77C public static TimeSpan FromSeconds(double value) { return TimeSpan.From(value, 10000000L); } /// Returns a that represents a specified number of milliseconds. /// A that represents . /// A number of milliseconds. /// /// is less than or greater than .-or- is .-or- is . /// /// is equal to . /// 1 // Token: 0x060040C3 RID: 16579 RVA: 0x000DC58C File Offset: 0x000DA78C public static TimeSpan FromMilliseconds(double value) { return TimeSpan.From(value, 10000L); } // Token: 0x060040C4 RID: 16580 RVA: 0x000DC59C File Offset: 0x000DA79C private static TimeSpan From(double value, long tickMultiplicator) { if (double.IsNaN(value)) { throw new ArgumentException(Locale.GetText("Value cannot be NaN."), "value"); } if (double.IsNegativeInfinity(value) || double.IsPositiveInfinity(value) || value < (double)TimeSpan.MinValue.Ticks || value > (double)TimeSpan.MaxValue.Ticks) { throw new OverflowException(Locale.GetText("Outside range [MinValue,MaxValue]")); } TimeSpan timeSpan; try { value *= (double)(tickMultiplicator / 10000L); checked { long num = (long)Math.Round(value); timeSpan = new TimeSpan(num * 10000L); } } catch (OverflowException) { throw new OverflowException(Locale.GetText("Resulting timespan is too big.")); } return timeSpan; } /// Returns a that represents a specified time, where the specification is in units of ticks. /// A with a value of . /// A number of ticks that represent a time. /// 1 // Token: 0x060040C5 RID: 16581 RVA: 0x000DC678 File Offset: 0x000DA878 public static TimeSpan FromTicks(long value) { return new TimeSpan(value); } /// Returns a hash code for this instance. /// A 32-bit signed integer hash code. /// 2 // Token: 0x060040C6 RID: 16582 RVA: 0x000DC680 File Offset: 0x000DA880 public override int GetHashCode() { return this._ticks.GetHashCode(); } /// Returns a new object whose value is the negated value of this instance. /// A new object with the same numeric value as this instance, but with the opposite sign. /// The negated value of this instance cannot be represented by a ; that is, the value of this instance is . /// 1 // Token: 0x060040C7 RID: 16583 RVA: 0x000DC690 File Offset: 0x000DA890 public TimeSpan Negate() { if (this._ticks == TimeSpan.MinValue._ticks) { throw new OverflowException(Locale.GetText("This TimeSpan value is MinValue and cannot be negated.")); } return new TimeSpan(-this._ticks); } /// Constructs a new object from a time interval specified in a string. /// A that corresponds to . /// A string that specifies a time interval. /// /// is null. /// /// has an invalid format. /// /// represents a number less than or greater than .-or- At least one of the days, hours, minutes, or seconds components is outside its valid range. /// 1 // Token: 0x060040C8 RID: 16584 RVA: 0x000DC6D4 File Offset: 0x000DA8D4 public static TimeSpan Parse(string s) { if (s == null) { throw new ArgumentNullException("s"); } TimeSpan.Parser parser = new TimeSpan.Parser(s); return parser.Execute(); } /// Constructs a new object from a time interval specified in a string. Parameters specify the time interval and the variable where the new object is returned. /// true if was converted successfully; otherwise, false. This operation returns false if the parameter is null, has an invalid format, represents a time interval less than or greater than , or has at least one days, hours, minutes, or seconds component outside its valid range. /// A string that specifies a time interval. /// When this method returns, contains an object that represents the time interval specified by , or if the conversion failed. This parameter is passed uninitialized. /// 1 // Token: 0x060040C9 RID: 16585 RVA: 0x000DC700 File Offset: 0x000DA900 public static bool TryParse(string s, out TimeSpan result) { if (s == null) { result = TimeSpan.Zero; return false; } bool flag; try { result = TimeSpan.Parse(s); flag = true; } catch { result = TimeSpan.Zero; flag = false; } return flag; } /// Returns a new object whose value is the difference between the specified object and this instance. /// A new time interval whose value is the result of the value of this instance minus the value of . /// A . /// The return value is less than or greater than . /// 1 // Token: 0x060040CA RID: 16586 RVA: 0x000DC770 File Offset: 0x000DA970 public TimeSpan Subtract(TimeSpan ts) { TimeSpan timeSpan; try { timeSpan = new TimeSpan(checked(this._ticks - ts.Ticks)); } catch (OverflowException) { throw new OverflowException(Locale.GetText("Resulting timespan is too big.")); } return timeSpan; } /// Returns the string representation of the value of this instance. /// A string that represents the value of this instance. The return value is of the form: [-][d.]hh:mm:ss[.fffffff] Elements in square brackets ([ and ]) may not be included in the returned string. Colons and periods (: and.) are literal characters. The non-literal elements are listed in the following table.Item Description "-" A minus sign, which indicates a negative time span. No sign is included for a positive time span."d" The number of days in the time span. This element is omitted if the time span is less than one day. "hh" The number of hours in the time span, ranging from 0 to 23. "mm" The number of minutes in the time span, ranging from 0 to 59. "ss" The number of seconds in the time span, ranging from 0 to 59. "fffffff" Fractional seconds in the time span. This element is omitted if the time span does not include fractional seconds. If present, fractional seconds are always expressed using 7 decimal digits. Note:For more information about comparing the string representation of and Oracle data types, see article Q324577, "System.TimeSpan Does Not Match Oracle 9i INTERVAL DAY TO SECOND Data Type," in the Microsoft Knowledge Base at http://support.microsoft.com. /// 1 // Token: 0x060040CB RID: 16587 RVA: 0x000DC7D0 File Offset: 0x000DA9D0 public override string ToString() { StringBuilder stringBuilder = new StringBuilder(14); if (this._ticks < 0L) { stringBuilder.Append('-'); } if (this.Days != 0) { stringBuilder.Append(Math.Abs(this.Days)); stringBuilder.Append('.'); } stringBuilder.Append(Math.Abs(this.Hours).ToString("D2")); stringBuilder.Append(':'); stringBuilder.Append(Math.Abs(this.Minutes).ToString("D2")); stringBuilder.Append(':'); stringBuilder.Append(Math.Abs(this.Seconds).ToString("D2")); int num = (int)Math.Abs(this._ticks % 10000000L); if (num != 0) { stringBuilder.Append('.'); stringBuilder.Append(num.ToString("D7")); } return stringBuilder.ToString(); } /// Adds two specified instances. /// A whose value is the sum of the values of and . /// A . /// A . /// The resulting is less than or greater than . /// 3 // Token: 0x060040CC RID: 16588 RVA: 0x000DC8D0 File Offset: 0x000DAAD0 public static TimeSpan operator +(TimeSpan t1, TimeSpan t2) { return t1.Add(t2); } /// Indicates whether two instances are equal. /// true if the values of and are equal; otherwise, false. /// A . /// A TimeSpan. /// 3 // Token: 0x060040CD RID: 16589 RVA: 0x000DC8DC File Offset: 0x000DAADC public static bool operator ==(TimeSpan t1, TimeSpan t2) { return t1._ticks == t2._ticks; } /// Indicates whether a specified is greater than another specified . /// true if the value of is greater than the value of ; otherwise, false. /// A . /// A TimeSpan. /// 3 // Token: 0x060040CE RID: 16590 RVA: 0x000DC8F0 File Offset: 0x000DAAF0 public static bool operator >(TimeSpan t1, TimeSpan t2) { return t1._ticks > t2._ticks; } /// Indicates whether a specified is greater than or equal to another specified . /// true if the value of is greater than or equal to the value of ; otherwise, false. /// A . /// A TimeSpan. /// 3 // Token: 0x060040CF RID: 16591 RVA: 0x000DC904 File Offset: 0x000DAB04 public static bool operator >=(TimeSpan t1, TimeSpan t2) { return t1._ticks >= t2._ticks; } /// Indicates whether two instances are not equal. /// true if the values of and are not equal; otherwise, false. /// A . /// A TimeSpan. /// 3 // Token: 0x060040D0 RID: 16592 RVA: 0x000DC91C File Offset: 0x000DAB1C public static bool operator !=(TimeSpan t1, TimeSpan t2) { return t1._ticks != t2._ticks; } /// Indicates whether a specified is less than another specified . /// true if the value of is less than the value of ; otherwise, false. /// A . /// A TimeSpan. /// 3 // Token: 0x060040D1 RID: 16593 RVA: 0x000DC934 File Offset: 0x000DAB34 public static bool operator <(TimeSpan t1, TimeSpan t2) { return t1._ticks < t2._ticks; } /// Indicates whether a specified is less than or equal to another specified . /// true if the value of is less than or equal to the value of ; otherwise, false. /// A . /// A TimeSpan. /// 3 // Token: 0x060040D2 RID: 16594 RVA: 0x000DC948 File Offset: 0x000DAB48 public static bool operator <=(TimeSpan t1, TimeSpan t2) { return t1._ticks <= t2._ticks; } /// Subtracts a specified from another specified . /// A TimeSpan whose value is the result of the value of minus the value of . /// A . /// A TimeSpan. /// The return value is less than or greater than . /// 3 // Token: 0x060040D3 RID: 16595 RVA: 0x000DC960 File Offset: 0x000DAB60 public static TimeSpan operator -(TimeSpan t1, TimeSpan t2) { return t1.Subtract(t2); } /// Returns a whose value is the negated value of the specified instance. /// A with the same numeric value as this instance, but the opposite sign. /// A . /// The negated value of this instance cannot be represented by a ; that is, the value of this instance is . /// 3 // Token: 0x060040D4 RID: 16596 RVA: 0x000DC96C File Offset: 0x000DAB6C public static TimeSpan operator -(TimeSpan t) { return t.Negate(); } /// Returns the specified instance of . /// Returns . /// A . /// 3 // Token: 0x060040D5 RID: 16597 RVA: 0x000DC978 File Offset: 0x000DAB78 public static TimeSpan operator +(TimeSpan t) { return t; } /// Represents the number of ticks in 1 day. This field is constant. /// 1 // Token: 0x040019E2 RID: 6626 public const long TicksPerDay = 864000000000L; /// Represents the number of ticks in 1 hour. This field is constant. /// 1 // Token: 0x040019E3 RID: 6627 public const long TicksPerHour = 36000000000L; /// Represents the number of ticks in 1 millisecond. This field is constant. /// 1 // Token: 0x040019E4 RID: 6628 public const long TicksPerMillisecond = 10000L; /// Represents the number of ticks in 1 minute. This field is constant. /// 1 // Token: 0x040019E5 RID: 6629 public const long TicksPerMinute = 600000000L; /// Represents the number of ticks in 1 second. /// 1 // Token: 0x040019E6 RID: 6630 public const long TicksPerSecond = 10000000L; /// Represents the maximum value. This field is read-only. /// 1 // Token: 0x040019E7 RID: 6631 public static readonly TimeSpan MaxValue = new TimeSpan(long.MaxValue); /// Represents the minimum value. This field is read-only. /// 1 // Token: 0x040019E8 RID: 6632 public static readonly TimeSpan MinValue = new TimeSpan(long.MinValue); /// Represents the zero value. This field is read-only. /// 1 // Token: 0x040019E9 RID: 6633 public static readonly TimeSpan Zero = new TimeSpan(0L); // Token: 0x040019EA RID: 6634 private long _ticks; // Token: 0x020006B0 RID: 1712 private class Parser { // Token: 0x060040D6 RID: 16598 RVA: 0x000DC97C File Offset: 0x000DAB7C public Parser(string src) { this._src = src; this._length = this._src.Length; } // Token: 0x17000BF9 RID: 3065 // (get) Token: 0x060040D7 RID: 16599 RVA: 0x000DC99C File Offset: 0x000DAB9C public bool AtEnd { get { return this._cur >= this._length; } } // Token: 0x060040D8 RID: 16600 RVA: 0x000DC9B0 File Offset: 0x000DABB0 private void ParseWhiteSpace() { while (!this.AtEnd && char.IsWhiteSpace(this._src, this._cur)) { this._cur++; } } // Token: 0x060040D9 RID: 16601 RVA: 0x000DC9F4 File Offset: 0x000DABF4 private bool ParseSign() { bool flag = false; if (!this.AtEnd && this._src[this._cur] == '-') { flag = true; this._cur++; } return flag; } // Token: 0x060040DA RID: 16602 RVA: 0x000DCA38 File Offset: 0x000DAC38 private int ParseInt(bool optional) { if (optional && this.AtEnd) { return 0; } int num = 0; int num2 = 0; while (!this.AtEnd && char.IsDigit(this._src, this._cur)) { num = checked(num * 10 + (int)this._src[this._cur] - 48); this._cur++; num2++; } if (!optional && num2 == 0) { this.formatError = true; } return num; } // Token: 0x060040DB RID: 16603 RVA: 0x000DCAC4 File Offset: 0x000DACC4 private bool ParseOptDot() { if (this.AtEnd) { return false; } if (this._src[this._cur] == '.') { this._cur++; return true; } return false; } // Token: 0x060040DC RID: 16604 RVA: 0x000DCB08 File Offset: 0x000DAD08 private void ParseOptColon() { if (!this.AtEnd) { if (this._src[this._cur] == ':') { this._cur++; } else { this.formatError = true; } } } // Token: 0x060040DD RID: 16605 RVA: 0x000DCB48 File Offset: 0x000DAD48 private long ParseTicks() { long num = 1000000L; long num2 = 0L; bool flag = false; while (num > 0L && !this.AtEnd && char.IsDigit(this._src, this._cur)) { num2 += (long)(this._src[this._cur] - '0') * num; this._cur++; num /= 10L; flag = true; } if (!flag) { this.formatError = true; } return num2; } // Token: 0x060040DE RID: 16606 RVA: 0x000DCBD0 File Offset: 0x000DADD0 public TimeSpan Execute() { int num = 0; this.ParseWhiteSpace(); bool flag = this.ParseSign(); int num2 = this.ParseInt(false); if (this.ParseOptDot()) { num = this.ParseInt(true); } else if (!this.AtEnd) { num = num2; num2 = 0; } this.ParseOptColon(); int num3 = this.ParseInt(true); this.ParseOptColon(); int num4 = this.ParseInt(true); long num5; if (this.ParseOptDot()) { num5 = this.ParseTicks(); } else { num5 = 0L; } this.ParseWhiteSpace(); if (!this.AtEnd) { this.formatError = true; } if (num > 23 || num3 > 59 || num4 > 59) { throw new OverflowException(Locale.GetText("Invalid time data.")); } if (this.formatError) { throw new FormatException(Locale.GetText("Invalid format for TimeSpan.Parse.")); } long num6 = TimeSpan.CalculateTicks(num2, num, num3, num4, 0); checked { num6 = ((!flag) ? (num6 + num5) : ((long)(unchecked((ulong)0) - (ulong)num6 - (ulong)num5))); return new TimeSpan(num6); } } // Token: 0x040019EB RID: 6635 private string _src; // Token: 0x040019EC RID: 6636 private int _cur; // Token: 0x040019ED RID: 6637 private int _length; // Token: 0x040019EE RID: 6638 private bool formatError; } } }