public static bool ValidateText(String text, int encoding) { if (encoding == Barcode.CODE_39) { return(Code39.ValidateCode39(text)); } else if (encoding == Barcode.CODE_39_MOD_43) { return(Code39.ValidateCode39mod43(text)); } else if (encoding == Barcode.FULL_ASCII_CODE_39) { return(Code39.ValidateFullAsciiCode39(text)); } else if (encoding == Barcode.POSTNET) { return(Postnet.Validate(text)); } else { return(false); } }
internal static bool ValidateText(string text, int encoding) { switch (encoding) { case CODE_39: return(Code39.ValidateCode39(text)); case CODE_39_MOD_43: return(Code39.ValidateCode39mod43(text)); case FULL_ASCII_CODE_39: return(Code39.ValidateFullAsciiCode39(text)); case POSTNET: return(Postnet.Validate(text)); case UPCA: return(UPCa.Validate(text)); default: return(false); } }