public void ParseLine(string line)
        {
            var parts = line.Split(',');

            if (parts[0] == "MNO")
            {
                var valueHolder = new ValueHolder(parts);
            }
        }
 public void ParseLine(string line)
 {
     if (line.StartsWith("MNO"))
     {
         int     elementId   = ParseSectionAsInt(line, 1);     // equal to parts[1] - element id
         int     vehicleId   = ParseSectionAsInt(line, 2);     // equal to parts[2] - vehicle id
         int     term        = ParseSectionAsInt(line, 3);     // equal to parts[3] - term
         int     mileage     = ParseSectionAsInt(line, 4);     // equal to parts[4] - mileage
         decimal value       = ParseSectionAsDecimal(line, 5); // equal to parts[5] - value
         var     valueHolder = new ValueHolder(elementId, vehicleId, term, mileage, value);
     }
 }
Esempio n. 3
0
 public void ParseLine(string line)
 {
     if (line.StartsWith("MNO"))
     {
         var findCommasInLine = FindCommasInLine(line);
         var elementId        = ParseSectionAsInt(findCommasInLine[0] + 1, findCommasInLine[1], line);     // equal to parts[1] - element id
         var vehicleId        = ParseSectionAsInt(findCommasInLine[1] + 1, findCommasInLine[2], line);     // equal to parts[2] - vehicle id
         var term             = ParseSectionAsInt(findCommasInLine[2] + 1, findCommasInLine[3], line);     // equal to parts[3] - term
         var mileage          = ParseSectionAsInt(findCommasInLine[3] + 1, findCommasInLine[4], line);     // equal to parts[4] - mileage
         var value            = ParseSectionAsDecimal(findCommasInLine[4] + 1, findCommasInLine[5], line); // equal to parts[5] - value
         var valueHolder      = new ValueHolder(elementId, vehicleId, term, mileage, value);
     }
 }
        public void ParseLine(string line)
        {
            if (line.StartsWith("MNO"))
            {
                var tempBuffer = _arrayPool.Rent(7);

                try
                {
                    var findCommasInLine = FindCommasInLine(line, tempBuffer);
                    var elementId        = ParseSectionAsInt(line, findCommasInLine[0] + 1, findCommasInLine[1]);     // equal to parts[1] - element id
                    var vehicleId        = ParseSectionAsInt(line, findCommasInLine[1] + 1, findCommasInLine[2]);     // equal to parts[2] - vehicle id
                    var term             = ParseSectionAsInt(line, findCommasInLine[2] + 1, findCommasInLine[3]);     // equal to parts[3] - term
                    var mileage          = ParseSectionAsInt(line, findCommasInLine[3] + 1, findCommasInLine[4]);     // equal to parts[4] - mileage
                    var value            = ParseSectionAsDecimal(line, findCommasInLine[4] + 1, findCommasInLine[5]); // equal to parts[5] - value
                    var valueHolder      = new ValueHolder(elementId, vehicleId, term, mileage, value);
                }
                finally
                {
                    _arrayPool.Return(tempBuffer, true);
                }
            }
        }