Exemplo n.º 1
0
        protected override string ParseText(string value, CodedValueCollection codes)
        {
            value = base.ParseText(value, codes);
            value = Regex.Replace(value, "[-\\s]", "");

            byte[] data1 = IntelligentMailHelper.Instance.ConvertToBytes(IntelligentMailHelper.Instance.ConvertRoutingCode(value.Substring(20)), value.Substring(0,20));
            int fcs = IntelligentMailHelper.Instance.CRC11(data1);

            short[] data2 = IntelligentMailHelper.Instance.ConvertToCodewords(data1);

            if (IntelligentMailHelper.Instance.CheckFcs(fcs))
                data2[0] += 659;

            IntelligentMailHelper.Instance.ConvertToCharacters(data2);

            IntelligentMailHelper.Instance.IncludeFcs(data2, fcs);

            codes.AddRange(IntelligentMailHelper.Instance.ConvertToBars(data2));

            return null;
        }
Exemplo n.º 2
0
        protected override string ParseText(string value, CodedValueCollection codes)
        {
            value = base.ParseText(value, codes);
            value = Regex.Replace(value, "[-\\s]", "");

            byte[] data1 = IntelligentMailHelper.Instance.ConvertToBytes(IntelligentMailHelper.Instance.ConvertRoutingCode(value.Substring(20)), value.Substring(0, 20));
            int    fcs   = IntelligentMailHelper.Instance.CRC11(data1);

            short[] data2 = IntelligentMailHelper.Instance.ConvertToCodewords(data1);

            if (IntelligentMailHelper.Instance.CheckFcs(fcs))
            {
                data2[0] += 659;
            }

            IntelligentMailHelper.Instance.ConvertToCharacters(data2);

            IntelligentMailHelper.Instance.IncludeFcs(data2, fcs);

            codes.AddRange(IntelligentMailHelper.Instance.ConvertToBars(data2));

            return(null);
        }
Exemplo n.º 3
0
        public override CodedValueCollection GetCodes(string value)
        {
            var codes = new CodedValueCollection();

            value = Regex.Replace(value, "[-\\s]", "");
            byte[] data1 = ConvertToBytes(ConvertRoutingCode(value.Substring(20)), value.Substring(0, 20));
            int    fcs   = CRC11(data1);

            short[] data2 = ConvertToCodewords(data1);

            if (CheckFcs(fcs))
            {
                data2[0] += 659;
            }

            ConvertToCharacters(data2);

            IncludeFcs(data2, fcs);

            codes.AddRange(ConvertToBars(data2));

            return(codes);
        }
Exemplo n.º 4
0
        public override CodedValueCollection GetCodes(string value)
        {
            var codes = new CodedValueCollection();

            value = Regex.Replace(value, "[-\\s]", "");
            byte[] data1 = ConvertToBytes(ConvertRoutingCode(value.Substring(20)), value.Substring(0, 20));
            int fcs = CRC11(data1);

            short[] data2 = ConvertToCodewords(data1);

            if (CheckFcs(fcs))
                data2[0] += 659;

            ConvertToCharacters(data2);

            IncludeFcs(data2, fcs);

            codes.AddRange(ConvertToBars(data2));

            return codes;
        }