Ejemplo n.º 1
0
		public static FileViewModel FromFile(string fileName)
		{
			var hexFileInfo = new HEXFileInfo()
			{
				HexMemoryType = HexMemoryType.Controller_AVR,
				FileName = new FileInfo(fileName).Name,
				Lines = File.ReadAllLines(fileName).ToList()
			};
			var fileViewModel = new FileViewModel(hexFileInfo, true);
			return fileViewModel;
			//var hexInfo = FirmwareUpdateOperationHelper.GetHexInfo(fileName);
		}
Ejemplo n.º 2
0
		void CopyProperties(HexFileCollectionInfo hexFileCollectionInfo)
		{
			SelectedDriver = hexFileCollectionInfo.DriverType;
			Name = hexFileCollectionInfo.Name;
			MinorVersion = hexFileCollectionInfo.MinorVersion;
			MajorVersion = hexFileCollectionInfo.MajorVersion;
			AutorName = hexFileCollectionInfo.AutorName;

			Files = new ObservableRangeCollection<FileViewModel>();
			foreach (var fileInfo in hexFileCollectionInfo.FileInfos)
			{
				var fileViewModel = new FileViewModel(fileInfo, false);
				Files.Add(fileViewModel);
				SelectedFile = Files.FirstOrDefault();
			}
		}