[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable <TimeSpan>
-#if NET_4_0 || MOBILE
+#if NET_4_0
, IFormattable
#endif
{
return p.Execute (true, out result);
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
public static TimeSpan Parse (string input, IFormatProvider formatProvider)
{
if (input == null)
return sb.ToString ();
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
public string ToString (string format)
{
return ToString (format, null);
private int _cur = 0;
private int _length;
ParseError parse_error;
-#if NET_4_0 || MOBILE
+#if NET_4_0
bool parsed_ticks;
NumberFormatInfo number_format;
int parsed_numbers_count;
{
_src = src;
_length = _src.Length;
-#if NET_4_0 || MOBILE
+#if NET_4_0
number_format = GetNumberFormatInfo (null);
#endif
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
// Reset state data, so we can execute another parse over the input.
void Reset ()
{
return res;
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
// Used for custom formats parsing, where we may need to declare how
// many digits we expect, as well as the maximum allowed.
private int ParseIntExact (int digit_count, int max_digit_count)
if (!optional && (count == 0))
SetParseError (ParseError.Format);
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (count > 0)
parsed_numbers_count++;
#endif
return (int)res;
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
// This behaves pretty much like ParseOptDot, but we need to have it
// as a separated routine for both days and decimal separators.
private bool ParseOptDaysSeparator ()
if (!digitseen)
SetParseError (ParseError.Format);
-#if NET_4_0 || MOBILE
+#if NET_4_0
else if (!AtEnd && Char.IsDigit (_src, _cur))
SetParseError (ParseError.Overflow);
return res;
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
// Used by custom formats parsing
// digits_count = 0 for digits up to max_digits_count (optional), and other value to
// force a precise number of digits.
parse_error = error;
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
bool CheckParseSuccess (bool tryParse)
#else
bool CheckParseSuccess (int hours, int minutes, int seconds, bool tryParse)
{
// We always report the first error, but for 2.0 we need to give a higher
// precence to per-element overflow (as opposed to int32 overflow).
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (parse_error == ParseError.Overflow) {
#else
if (parse_error == ParseError.Overflow || hours > 23 || minutes > 59 || seconds > 59) {
return true;
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
// We are using a different parse approach in 4.0, due to some changes in the behaviour
// of the parse routines.
// The input string is documented as:
}
#endif
-#if NET_4_0 || MOBILE
+#if NET_4_0
public bool ExecuteWithFormat (string format, TimeSpanStyles style, bool tryParse, out TimeSpan result)
{
int days, hours, minutes, seconds;
}
#endif
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
enum FormatElementType
{
Days,