Пример #1
0
        public void SetAndDisplayDataFile(string filePath, MessageTypeCollection messageTypes)
        {
            DataFileInfo dataFileInfo = new DataFileInfo(filePath);

            SetDataFile(dataFileInfo);
            MyDataFile.ParseDataFromFileIntoBytes(filePath);
            DisplayDataFile(messageTypes);
        }
Пример #2
0
 public DataFile MakeDataFile(DataFileInfo d)
 {
     if (d.FileName.Contains(".txt"))
     {
         return(new AsciiFile(d));
     }
     else if (d.FileName.Contains(".hex"))
     {
         return(new HexFile(d));
     }
     else if (d.FileName.Contains(".dat"))
     {
         return(new DatFile());
     }
     else
     {
         throw new Exception("No file type selected");
     }
 }
Пример #3
0
 public AsciiFile(DataFileInfo d)
 {
     filename = d.FileName;
 }
Пример #4
0
        public void SetDataFile(DataFileInfo dataFileInfo)
        {
            DataFileFactoryImpl dataFileFactory = new DataFileFactoryImpl();

            MyDataFile = dataFileFactory.MakeDataFile(dataFileInfo);
        }
Пример #5
0
 public HexFile(DataFileInfo d)
 {
     filename = d.FileName;
 }