Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryParseComponent()

static bool System.Version.TryParseComponent ( ReadOnlySpan< char > component,
string componentName,
bool throwOnFailure,
out int parsedComponent )
inlinestaticprivate

Definition at line 402 of file Version.cs.

403 {
404 if (throwOnFailure)
405 {
406 if ((parsedComponent = int.Parse(component, NumberStyles.Integer, CultureInfo.InvariantCulture)) < 0)
407 {
408 throw new ArgumentOutOfRangeException(componentName, SR.ArgumentOutOfRange_Version);
409 }
410 return true;
411 }
412 if (int.TryParse(component, NumberStyles.Integer, CultureInfo.InvariantCulture, out parsedComponent))
413 {
414 return parsedComponent >= 0;
415 }
416 return false;
417 }
static CultureInfo InvariantCulture
static Version Parse(string input)
Definition Version.cs:310
static bool TryParse([NotNullWhen(true)] string? input, [NotNullWhen(true)] out Version? result)
Definition Version.cs:324

References System.SR.ArgumentOutOfRange_Version, System.Globalization.CultureInfo.InvariantCulture, System.Version.Parse(), and System.Version.TryParse().

Referenced by System.Version.ParseVersion().