private void AddReportViewModel(SynchronizationReportName reportName) { string profileName; if (!_currentProfileNamesById.TryGetValue(reportName.SyncronizationProfileId, out profileName)) { profileName = "<Not existing anymore>"; } var reportProxy = new ReportProxy(reportName, () => _reportRepository.GetReport(reportName), profileName); var reportViewModel = new ReportViewModel(reportProxy, _reportRepository, this); _reports.Add(reportViewModel); }
public void ShowLatestSynchronizationReportCommand(Guid profileId) { ReportViewModel latestReport = null; foreach (var report in _reports.Where(r => r.ProfileId == profileId)) { if (latestReport == null || report.StartTime > latestReport.StartTime) { latestReport = report; } } _selectedReports.Clear(); if (latestReport != null) { _selectedReports.Add(latestReport); } }
public void ShowLatestSynchronizationReportCommand(Guid profileId) { foreach (var report in _reports) { report.IsSelected = false; } ReportViewModel latestReport = null; foreach (var report in _reports.Where(r => r.ProfileId == profileId)) { if (latestReport == null || report.StartTime > latestReport.StartTime) { latestReport = report; } } if (latestReport != null) { latestReport.IsSelected = true; } }
private void AddReportViewModel (SynchronizationReportName reportName, SynchronizationReport report) { string profileName; if (!_currentProfileNamesById.TryGetValue (reportName.SyncronizationProfileId, out profileName)) profileName = "<Not existing anymore>"; var reportProxy = new ReportProxy (reportName, () => report, profileName); var reportViewModel = new ReportViewModel (reportProxy, _reportRepository, this); _reports.Add (reportViewModel); }