public ElasticVersion()

in Elastic.Console/ElasticVersion.cs [45:69]


        public ElasticVersion(string version)
        {
            var match = VersionRegex.Match(version);
            if (!match.Success)
                throw new ArgumentException(string.Format("Invalid version '{0}'", version), "version");

            var major = int.Parse(match.Groups["major"].Value, CultureInfo.InvariantCulture);

            var minorMatch = match.Groups["minor"];
            int minor = 0;
            if (minorMatch.Success) 
                minor = int.Parse(minorMatch.Value, CultureInfo.InvariantCulture);

            var patchMatch = match.Groups["patch"];
            int patch = 0;
            if (patchMatch.Success)
                patch = int.Parse(patchMatch.Value, CultureInfo.InvariantCulture);

            var prerelease = match.Groups["pre"].Value;
            
            this.Major = major;
            this.Minor = minor;
            this.Patch = patch;
            this.Prerelease = prerelease;
        }