public IQueryable <RestoreDataViewModel> GetBackupInfo(string backupInfoPath) { var restoreDataList = new List <RestoreDataViewModel>(); try { using (var file = new StreamReader(backupInfoPath)) { string line; while ((line = file.ReadLine()) != null) { var lineInfo = line.Split(';'); if (lineInfo.Any()) { var backupDate = lineInfo[0]; var bkpFileName = lineInfo[1]; var backupDescription = lineInfo[2]; var restoreData = new RestoreDataViewModel() { BackupD = DateTime.Parse(backupDate), BackupFileName = bkpFileName, Description = backupDescription, }; restoreDataList.Add(restoreData); } } } return(restoreDataList.AsQueryable()); } catch (Exception) { return(null); } }
public RestoreDataView(RestoreDataViewModel model) { InitializeComponent(); this.DataContext = model; this._viewmodel = model; }