void projectOverview_RunLogDblClicked(object sender, EventArgs e) { LogOverview logOverview = new LogOverview((RunLog)sender, applicationInitializer.ModuleLoader.Modules); logOverview.BackButtonClicked += backButtonClicked; this.mainWindowContent.Content = logOverview; }
public Task PopulateLogsRootAsync( MvxObservableCollection <LogOverview> logOverviews, string path, Action propertyChanges) { return(Task.Run( () => { var start = DateTime.Now; if (!Directory.Exists(path)) { Popup.ShowWarning(Messages.RootDirDoesntExist); return; } var logDirs = Directory.GetDirectories(path).OrderByDescending(Directory.GetLastWriteTime); foreach (var dir in logDirs) { this.logger.AddDetailMessage(Messages.GetScanningDir(dir)); var logDir = Directory.GetDirectories(dir).OrderByDescending(Directory.GetCreationTime).FirstOrDefault(); if (string.IsNullOrEmpty(logDir)) { this.logger.AddDetailMessage(Messages.GetDirIsEmpty(logDir)); continue; } var logOverview = new LogOverview { History = this.GetLogHistory(dir) }; logOverviews.Add(logOverview); propertyChanges.Invoke(); } var diff = DateTime.Now.Subtract(start); this.logger.AddMessage(Messages.GetCollectingLogsDuration(diff.TotalSeconds)); })); }