public BackgroundUpdater(WatcherView view, WatcherViewModel viewModel, WatcherController controller)
        {
            this.viewModel = viewModel;

            worker = new BackgroundWorker();
            worker.DoWork += worker_DoWork;

            UpdateStarted += view.StartUpdating;
            UpdateCompleted += view.FinishUpdating;
            Update += controller.UpdateBuilds;
        }
Example #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var config = ConfigurationManager.AppSettings;

            var saveRepositroy = new SaveStateRepository(config["SaveFile"]);
            var tcRepository = new TeamCityRepository(config["TeamCityHost"], config["TeamCityUser"], config["TeamCityPassword"]);
            var viewModel = new WatcherViewModel(Convert.ToInt32(config["UpdateInterval"]));
            var controller = new WatcherController(viewModel, tcRepository, saveRepositroy);
            var view = new WatcherView(viewModel, controller);
            var updater = new BackgroundUpdater(view, viewModel, controller);
            updater.Start();

            Application.Run(view);
        }