예제 #1
0
        private static int[] GetIndices(string value, int start, int final)
        {
            List <int> intList = new List <int>();
            int        final1;

            for (; start < final; start = final1)
            {
                final1 = Code128C.GetSwitch(value, start, final);
                if (final1 > start)
                {
                    intList.AddRange((IEnumerable <int>)Code128C.GetIndices(value, start, final1));
                }
                else
                {
                    int val1 = Code128A.GetSwitch(value, start, final);
                    int val2 = Code128B.GetSwitch(value, start, final);
                    final1 = Math.Max(val1, val2);
                    if (val1 >= val2)
                    {
                        intList.AddRange((IEnumerable <int>)Code128A.GetIndices(value, start, final1));
                    }
                    else
                    {
                        intList.AddRange((IEnumerable <int>)Code128B.GetIndices(value, start, final1));
                    }
                }
            }
            return(intList.ToArray());
        }
예제 #2
0
 internal static int GetSwitch(string value, int start, int final)
 {
     for (int start1 = start; start1 < final; ++start1)
     {
         if (!Code128A.Charset.Contains(value[start1]) || Code128C.GetSwitch(value, start1, final) > start1)
         {
             return(start1);
         }
     }
     return(final);
 }