using NTwain.Properties; using System; namespace NTwain { /// /// Some utility stuff. /// public static class Extensions { /// /// Verifies the string length is under the maximum length /// and throws if violated. /// /// The value. /// The maximum length. internal static void VerifyLengthUnder(this string value, int maxLength) { if (value != null && value.Length > maxLength) throw new ArgumentException(Resources.MaxStringLengthExceeded); } } }