Exemplo n.º 1
0
        private void ProcessEntry(NeaReader reader)
        {
            String[] fields = new String[fieldcount];
            for (int i = 0; i < fieldcount; i++)
            {
                fields[i] = reader.ReadUntilAny(";");
                if (reader.Peek() == -1)
                {
                    return;
                }
            }
            int month;
            int year;

            try {
                String smonth = fields[datefield].Substring(3, 2);
                String syear  = fields[datefield].Substring(6, 2);
                month = int.Parse(smonth) - 1;
                year  = int.Parse(syear) + 2000;
                if (month < 4)
                {
                    year--;
                }

                //make month 0 be May, and month 11 be April
                month -= 4;
                if (month < 0)
                {
                    month += 12;
                }
            }
            catch (Exception e) {
                return;
            }
            YearInfo y = GetYear(year);

            if (y == null)
            {
                y = new YearInfo(year);
                years.Add(y);
            }
            y.AddEntry(month, fields);
        }