Example #1
0
        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;
        }
Example #2
0
        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();
        }
Example #3
0
 public BackgroundExecution(ProgressService progressService, DialogService dialogs)
 {
     _progressService = progressService;
     _dialogs         = dialogs;
 }