diff options
Diffstat (limited to 'src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs')
-rw-r--r-- | src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs b/src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs index 7e4d0220..077c0361 100644 --- a/src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs +++ b/src/SMAPI.Toolkit/Framework/UpdateData/UpdateKey.cs @@ -89,6 +89,16 @@ namespace StardewModdingAPI.Toolkit.Framework.UpdateData return new UpdateKey(raw, site, id, subkey); } + /// <summary>Parse a raw update key if it's valid.</summary> + /// <param name="raw">The raw update key to parse.</param> + /// <param name="parsed">The parsed update key, if valid.</param> + /// <returns>Returns whether the update key was successfully parsed.</returns> + public static bool TryParse(string raw, out UpdateKey parsed) + { + parsed = UpdateKey.Parse(raw); + return parsed.LooksValid; + } + /// <summary>Get a string that represents the current object.</summary> public override string ToString() { |