401 {
402 if (((uint)style & 0xFFFFFFF8u) != 0 ||
formats ==
null)
403 {
405 return ParseFailureKind.FormatWithParameter;
406 }
409 {
412 if (
string.IsNullOrEmpty(
text))
413 {
415 return ParseFailureKind.FormatWithFormatSpecifier;
416 }
417 if (
text.Length == 1)
418 {
420 {
421 case 'O':
422 case 'o':
423 text =
"HH':'mm':'ss'.'fffffff";
425 break;
426 case 'R':
427 case 'r':
428 text =
"HH':'mm':'ss";
430 break;
431 }
432 }
433 DateTimeResult result2 = default(DateTimeResult);
435 if (DateTimeParse.TryParseExact(
s,
text, dtfi, style, ref result2) && (result2.flags & (ParseFlags.HaveYear | ParseFlags.HaveMonth | ParseFlags.HaveDay | ParseFlags.HaveDate | ParseFlags.TimeZoneUsed | ParseFlags.TimeZoneUtc | ParseFlags.ParsedMonthName | ParseFlags.CaptureOffset | ParseFlags.UtcSortPattern)) == 0)
436 {
437 result =
new TimeOnly(result2.parsedDate.TimeOfDay.Ticks);
438 return ParseFailureKind.None;
439 }
440 }
442 return ParseFailureKind.FormatWithOriginalDateTime;
443 }
static CultureInfo InvariantCulture
TimeOnly(int hour, int minute)