コード例 #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;
 }