/// <summary> /// Checks the code to be convertible into an interleaved 2 of 5 bar code. /// </summary> /// <param name="text">The code to be checked.</param> protected override void CheckCode(string text) { //#if true_ if (text == null) { throw new ArgumentNullException("text"); } if (text == "") { throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); } if (text.Length % 2 != 0) { throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); } foreach (char ch in text) { if (!Char.IsDigit(ch)) { throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); } } //#endif }
/// <summary> /// Checks the code to be convertible into an interleaved 2 of 5 bar code. /// </summary> /// <param name="text">The code to be checked.</param> protected override void CheckCode(string text) { // NOTE: this was commented out in the original source if (text == null) { throw new ArgumentNullException(nameof(text)); } if (text == "") { throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); } if (text.Length % 2 != 0) { throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); } foreach (char ch in text) { if (!Char.IsDigit(ch)) { throw new ArgumentException(BcgSR.Invalid2Of5Code(text)); } } }