public virtual bool ReadCsvLineData(List <string> data)
        {
            bool ret = false;

            if (data.Count < 10)
            {
                Console.Out.WriteLine("Insufficient data count. Skipping record.");
                return(ret);
            }

            //ret = _id.SetValue(_id.Header, data[0], true) || ret; // id should be read only
            ret = _actor.SetValue(_actor.Header, data[1], true) || ret;
            //ret = _start.SetValue(_start.Header, data[2], true) || ret; // start should be read only
            ret = _unknown.SetValue(_unknown.Header, data[3], true) || ret;
            data.RemoveRange(0, 4);

            if (_timing != null)
            {
                ret = _timing.ReadCsvData(data) || ret;
            }
            else
            {
                MtpTimingEntry.TrimData(data);
            }
            if (_sentence != null)
            {
                ret = _sentence.ReadCsvData(data) || ret;
            }
            else
            {
                MtpSentence.TrimData(data);
            }

            return(ret);
        }
Exemple #2
0
 public void Write(FileStream stream, MtpSentence previous)
 {
     _size.WriteToFile(stream);
     if (_sentence != null)
     {
         PadSentence();
         _sentence.WriteToFile(stream);
     }
 }
        public void ReadEntry(FileStream stream)
        {
            _id.ReadFromFile(stream);
            _actor.ReadFromFile(stream);
            _start.ReadFromFile(stream);
            _unknown.ReadFromFile(stream);

            ReadTiming(stream);

            _sentence = new MtpSentence(_parser.SentencesStart + _start.GetValueAsRawInt());
            _sentence.Read(stream);
        }
        public void ReadEntry(FileStream stream)
        {
            _id.ReadFromFile(stream);
            _actor.ReadFromFile(stream);
            _start.ReadFromFile(stream);
            _unknown.ReadFromFile(stream);

            ReadTiming(stream);

            _sentence = new MtpSentence(_parser.SentencesStart + _start.GetValueAsRawInt());
            _sentence.Read(stream);
        }
Exemple #5
0
 public void Write(FileStream stream, MtpSentence previous)
 {
     _size.WriteToFile(stream);
     if (_sentence != null)
     {
         PadSentence();
         _sentence.WriteToFile(stream);
     }
 }
 public static void WriteCsvHeaders(StreamWriter stream)
 {
     stream.Write("hId,hActor,hStart,hUnknown,");
     MtpTimingEntry.WriteCsvHeaders(stream);
     MtpSentence.WriteCsvHeaders(stream);
 }