Esempio n. 1
0
        public static bool TryParse(string input, out InformationalVersion version)
        {
            version = default(InformationalVersion);
            var trim = input.TrimStart('v');
            var info = trim.Split(new[] { '-' }, 2);

            if (!Version.TryParse(info[0], out Version result))
            {
                return(false);
            }

            version = new InformationalVersion {
                Version = result
            };

            if (info.Length > 1)
            {
                version.Branch = info[1];
            }

            return(true);
        }
Esempio n. 2
0
        public static bool TryParse(string input, out InformationalVersion version)
        {
            version = default(InformationalVersion);
            var trim = input.TrimStart('v');
            var info = trim.Split('-');

            if (!Version.TryParse(info[0], out Version result))
            {
                return(false);
            }

            version = new InformationalVersion {
                Version = result
            };

            if (info.Length > 1)
            {
                version.Information = info.Skip(1).ToArray();
            }

            return(true);
        }