public MainWindow() { InitializeComponent(); // Last know project var project = Application.Current.Properties["project"] as Project; var viewController = new ViewController(this); var analyzer = new Analyzer(project); // TODO create on the fly? var dialogs = new DialogService(); var progressService = new ProgressService(this); var backgroundExecution = new BackgroundExecution(progressService, dialogs); // TODO too much var mainViewModel = new MainViewModel(viewController, dialogs, project, analyzer, backgroundExecution); DataContext = mainViewModel; }
private void App_OnStartup(object sender, StartupEventArgs e) { // Load thresholds from config file // Summary Thresholds.MaxWorkItemsPerCommitForSummary = Settings.Default.MaxWorkItemsPerCommitForSummary; // Hotspots Thresholds.MinCommitsForHotspots = Settings.Default.MinCommitsForHotspots; Thresholds.MinLinesOfCodeForHotspot = Settings.Default.MinLinesOfCodeForHotspot; // Coupling Thresholds.MinCouplingForChangeCoupling = Settings.Default.MinCouplingForChangeCoupling; Thresholds.MaxItemsInChangesetForChangeCoupling = Settings.Default.MaxItemsInChangesetForChangeCoupling; Thresholds.MinDegreeForChangeCoupling = Settings.Default.MinDegreeForChangeCoupling; //Current.Properties.Add("lastKnownProject", Settings.Default.LastKnownProject); // var lastKnownProject = Application.Current.Properties["lastKnownProject"] as string; var lastKnownProject = Settings.Default.LastKnownProject; var analyzer = new Analyzer(new MetricProvider(), Project.GetSupportedFileTypesForAnalysis()); // If there is an last project load it immediately var project = new Project(); if (!string.IsNullOrEmpty(lastKnownProject) && File.Exists(lastKnownProject)) { project = new Project(); project.Load(lastKnownProject); } var mainWindow = new MainWindow(); var viewController = new ViewController(mainWindow); var progressService = new ProgressService(mainWindow); var dialogs = new DialogService(); var backgroundExecution = new BackgroundExecution(progressService, dialogs); var mainViewModel = new MainViewModel(viewController, dialogs, backgroundExecution, analyzer, project); mainWindow.DataContext = mainViewModel; mainWindow.Show(); }
public BackgroundExecution(ProgressService progressService, DialogService dialogs) { _progressService = progressService; _dialogs = dialogs; }