private void _synchronizationReportRepository_ReportAdded(object sender, ReportAddedEventArgs e) { if (IsReportsViewVisible) { ShowReports(); // show to bring it into foreground return; } var hasErrors = e.Report.HasErrors; var hasWarnings = e.Report.HasWarnings; if (hasErrors || hasWarnings) { if (hasWarnings && _showReportsWithWarningsImmediately || hasErrors && _showReportsWithErrorsImmediately) { ShowReports(); var reportNameAsString = e.ReportName.ToString(); _currentReportsViewModel.Reports.Single(r => r.ReportName.ToString() == reportNameAsString).IsSelected = true; return; } var handler = SynchronizationFailedWhileReportsFormWasNotVisible; if (handler != null) { handler(this, EventArgs.Empty); } } }
private void ReportRepository_ReportAdded(object sender, ReportAddedEventArgs e) { AddReportViewModel(e.ReportName, e.Report); }