예제 #1
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);
        }
 public WatcherController(WatcherViewModel vm, TeamCityRepository tcRepo, SaveStateRepository saveRepo)
 {
     viewModel = vm;
     tcRepository = tcRepo;
     saveRepository = saveRepo;
 }