コード例 #1
0
        public LineRecord Read()
        {
            LineRecord record = null;

            string   name = string.Empty;
            DateTime time = new DateTime(0);

            while (true)
            {
                string line = this.mReader.ReadLine();
                if (line != null)
                {
                    GetRecord(line, out name, out time);
                    if (time.Ticks == 1)
                    {
                        continue;
                    }
                    else
                    {
                        record = new LineRecord(name, time);
                    }
                    break;
                }
                break;
            }

            return(record);
        }
コード例 #2
0
 public void GetRecords()
 {
     using (RecordReader reader = new RecordReader(this.fileName))
     {
         /*
          * Format record instance, add to collection
          */
         LineRecord record = null;
         while ((record = reader.Read()) != null)
         {
             if (Persons.ContainsKey(record.Name))
             {
                 Persons[record.Name].AddTime(record.Time);
             }
             else
             {
                 PersonRecord person = new PersonRecord(record.Name);
                 person.AddTime(record.Time);
                 Persons[record.Name] = person;
             }
         }
     }
 }