/// <summary>
        /// Creats a new version pattern from a given string representation
        /// </summary>
        /// <param name="patternString">The pattern string to parse into the version pattern</param>
        public VersionPattern(string patternString)
        {
            if(string.IsNullOrEmpty(patternString))
                throw new ArgumentException("The pattern string is null or empty");

            var pieces = patternString.Split('.');
            if(pieces.Count() != 4)
                throw new ArgumentException(string.Format("Was expecting exactly 4 elements in the version pattern string, instead found {0} for pattern \"{1}\"", pieces.Count(), patternString));

            Major = new VersionPartPattern(pieces[0]);
            Minor = new VersionPartPattern(pieces[1]);
            Build = new VersionPartPattern(pieces[2]);
            Revision = new VersionPartPattern(pieces[3]);
        }
 /// <summary>
 /// Gets the version part given the specified pattern part, context, and current value
 /// </summary>
 /// <param name="currentPartValue">The current value of the version part</param>
 /// <param name="partPattern">the pattern part to patch with</param>
 /// <param name="ctx">The generation context</param>
 /// <returns>The newly generated version part</returns>
 static int GetVersionPart(int currentPartValue, VersionPartPattern partPattern, VersionPartPatchingContext ctx)
 {
     return partPattern.Type == VersionPatternElementType.Literal 
         ? int.Parse(partPattern.Part) 
         : GeneratePart(partPattern.Part, currentPartValue, ctx);
 }