Esempio n. 1
0
        public LineContentType DetermineLineType(string lineText)
        {
            LineContentType detectedType = LineContentType.Unclassified;

            if (FullLineText.Contains("Directory of "))
            {
                detectedType = LineContentType.DirectoryLine;
                return(detectedType);
            }
            string datePart;

            try
            {
                if (lineText.Length < 10)
                {
                }
                datePart = lineText.Trim().Substring(0, 10);
                DateTime testDate;
                if (DateTime.TryParse(datePart, out testDate))
                {
                    detectedType = LineContentType.FileDataLine;
                    return(detectedType);
                }
                else
                {
                    detectedType = LineContentType.OtherLine;
                }
            }
            catch (Exception)
            {
                detectedType = LineContentType.OtherLine;
            }

            return(detectedType);
        }
 public Line(int no, LineContentType type, string content)
 {
     No          = no;
     Content     = content;
     ContentType = type;
 }
 public Line(int no, LineContentType type, string content)
 {
     No = no;
     Content = content;
     ContentType = type;
 }