public static string GetName(this PpkFormatter.Version aVersion) { switch (aVersion) { case PpkFormatter.Version.V1: return("1"); case PpkFormatter.Version.V2: return("2"); default: Debug.Fail("Unknown version"); throw new Exception("Unknown version"); } }
public static bool TryParseVersion(this string text, ref PpkFormatter.Version version) { switch (text) { case "1": version = PpkFormatter.Version.V1; return(true); case "2": version = PpkFormatter.Version.V2; return(true); default: return(false); } }