Exemple #1
0
        internal static List <int> GetCSValues(string encodedValuesPath)
        {
            List <int> intList   = new List <int>();
            string     allValues = BarcodeResources.GetAllValues(encodedValuesPath);
            string     empty1    = string.Empty;

            for (int index = 0; index < allValues.Length; ++index)
            {
                char ch = allValues[index];
                switch (ch)
                {
                case ' ':
                case ',':
                    if (empty1.Length > 0)
                    {
                        int num = int.Parse(empty1);
                        intList.Add(num);
                        empty1 = string.Empty;
                        break;
                    }
                    break;

                default:
                    empty1 += (string)(object)ch;
                    break;
                }
            }
            if (empty1.Length > 0)
            {
                int num = int.Parse(empty1);
                intList.Add(num);
                string empty2 = string.Empty;
            }
            return(intList);
        }
Exemple #2
0
        public static List <string> GetEncodedValues(string encodedValuesPath, int validStep)
        {
            List <string> stringList = new List <string>();
            string        allValues  = BarcodeResources.GetAllValues(encodedValuesPath);
            int           index1     = 0;

            while (index1 < allValues.Length)
            {
                switch (allValues[index1])
                {
                case ' ':
                case '"':
                case ',':
                    ++index1;
                    continue;

                default:
                    string empty = string.Empty;
                    for (int index2 = 0; index2 < validStep; ++index2)
                    {
                        char ch = allValues[index1 + index2];
                        empty += ch.ToString();
                    }
                    stringList.Add(empty);
                    index1 += validStep;
                    continue;
                }
            }
            return(stringList);
        }
Exemple #3
0
        internal static List <List <int> > GetBarSpaceSequence(
            string encodedValuesPath,
            int validStep)
        {
            List <int>         intList     = new List <int>();
            List <List <int> > intListList = new List <List <int> >();
            string             allValues   = BarcodeResources.GetAllValues(encodedValuesPath);
            int index1 = 0;

            while (index1 < allValues.Length)
            {
                switch (allValues[index1])
                {
                case '\n':
                case '\r':
                case ' ':
                case '"':
                case ',':
                    ++index1;
                    break;

                default:
                    string empty = string.Empty;
                    for (int index2 = 0; index2 < validStep; ++index2)
                    {
                        char ch = allValues[index1 + index2];
                        empty += ch.ToString();
                    }
                    intList.Add(int.Parse(empty));
                    index1 += validStep;
                    break;
                }
                if (intList.Count == 3)
                {
                    intListList.Add(new List <int>((IEnumerable <int>)intList));
                    intList.Clear();
                }
            }
            return(intListList);
        }
Exemple #4
0
 public KanjiMode()
 {
     this.unicodeValues      = BarcodeResources.GetEncodedValues("KanjiUni.txt", 4);
     this.shiftJISCodeValues = BarcodeResources.GetEncodedValues("KanjiShiftJS.txt", 4);
 }
 private static void InitializeBarSpaceSequence()
 {
     SpecificationData.BarSpaceSequence = new List <List <int> >();
     SpecificationData.BarSpaceSequence = BarcodeResources.GetBarSpaceSequence("BarSpaceSequence.txt", 8);
 }
        private static void InitializeLevelEightErrorCorrection()
        {
            List <int> csValues = BarcodeResources.GetCSValues("LevelEightEC.txt");

            SpecificationData.ErrorCorrectionLevels.Add(csValues);
        }
Exemple #7
0
 public ECIBase(string encPath, int validEncStep, string uniPath, int validUniStep)
 {
     this.encodedValues = BarcodeResources.GetEncodedValues(encPath, validEncStep);
     this.unicodeValues = BarcodeResources.GetEncodedValues(uniPath, validUniStep);
 }