Exemplo n.º 1
0
        public WorkingDaysLeftController(
            WorkingDaysLeftViewModel leftViewModel,
            WorkingDaysLeftSettingsViewModel settingsViewModel,
            IAsyncRepository<ProjectInfoServer> projectInforepository,
            IAsyncRepository<Holiday> holidayRepository,
            ITimer refreshNotifier,
            ILog logger,
            IProgressbar loadingNotifier,
            Configuration config)
        {
            this.leftViewModel = leftViewModel;
            this.settingsViewModel = settingsViewModel;
            this.holidayRepository = holidayRepository;
            this.projectInforepository = projectInforepository;
            this.logger = logger;
            this.loadingNotifier = loadingNotifier;
            this.refreshNotifier = refreshNotifier;

            this.Rand = new Random((int)DateTime.Now.Ticks).Next();

            projectInforepository.GetCompleted += GotProjectInfo;
            holidayRepository.GetCompleted += GotHolidays;

            this.settingsViewModel.RefreshAvailableServers.ExecuteDelegate = OnRefreshAvailableServers;
            this.settingsViewModel.ReloadSettings.ExecuteDelegate = settingsViewModel.Reset;

            refreshNotifier.Elapsed += refreshNotifier_Elapsed;
            settingsViewModel.PropertyChanged += RefreshAvailableProjectsWhenSelectedServerChanges;
            refreshNotifier.Start(10000);

            OnRefreshAvailableServers();
            SetConfigAndUpdate(config);
        }
Exemplo n.º 2
0
        public CorkboardController(CorkboardViewModel viewModel,
                                   CorkboardSettingsViewModel settingsViewModel, 
                                   IRepository<RetrospectiveNote> retrospectiveNoteRepository,
                                   IPersistDomainModelsAsync<RetrospectiveNote> persistRetrospectiveNoteRepository, 
                                   IDeleteDomainModelsAsync<RetrospectiveNote> deleteRetrospectiveNoteRepository,
                                   ITimer timer, 
                                   IUIInvoker uiInvoker, 
                                   IInvokeBackgroundWorker asyncClient, 
                                   ILog logger, 
                                   IProgressbar progressbar,
                                   Configuration config 
            )
        {
            _viewModel = viewModel;
            _settingsViewModel = settingsViewModel;
            _asyncClient = asyncClient;
            _repository = retrospectiveNoteRepository;
            _persistRepository = persistRetrospectiveNoteRepository;
            _uiInvoker = uiInvoker;
            _refreshNotifier = timer;
            _logger = logger;
            _progressBar = progressbar;
            _currentConfig = config;
            _deleteRepository = deleteRetrospectiveNoteRepository;
            
            _persistRepository.SaveCompleted += PersisterSaveCompleted;

            _refreshNotifier.Elapsed += (o, e) => UpdateViewModels();
            
            _settingsViewModel.Save.ExecuteDelegate = Save;
            _settingsViewModel.ReloadSettings.ExecuteDelegate = ReloadSettings;
            
            UpdateViewModels();
        }
Exemplo n.º 3
0
        public UsersController(
            UsersViewModel viewModel,
            IRepository<Userdb> userdbRepository,
            IPersistDomainModelsAsync<Userdb> userdbPersisterRepository,
            IInvokeBackgroundWorker<IEnumerable<Userdb>> asyncClient,
            ILog logger,
            IUIInvoker uiInvoker,
            IProgressbar loadingNotifier, 
            IMetadataService metadataService)
        {
            Guard.Requires<ArgumentException>(userdbRepository != null, "userdbRepository");
            Guard.Requires<ArgumentException>(userdbPersisterRepository != null, "userdbPersisterRepository");
            Guard.Requires<ArgumentException>(asyncClient != null, "asyncClient");
            Guard.Requires<ArgumentException>(logger != null, "logger");

            this.userdbRepository = userdbRepository;
            this.metadataService = metadataService;
            this.userdbPersisterRepository = userdbPersisterRepository;
            this.asyncClient = asyncClient;
            this.logger = logger;
            this.uiInvoker = uiInvoker;
            this.loadingNotifier = loadingNotifier;
            this.viewModel = viewModel;

            this.viewModel.Save.AfterExecute += (sender, args) => SaveDataToRepository();
            this.viewModel.Refresh.AfterExecute += (sender, args) => LoadData();
            this.viewModel.PropertyChanged += SelectedDbChanged;
            this.userdbPersisterRepository.SaveCompleted += OnSaveCompleted;

            LoadData();
        }
Exemplo n.º 4
0
	    public GraphController(Graph viewModel, 
            IDownloadStringService downloadStringService,
            ITimer timer,
            Configuration configuration,
            IProgressbar progressbarService)
		{
	        Guard.Requires<ArgumentNullException>(viewModel != null);
            Guard.Requires<ArgumentNullException>(downloadStringService != null);
            Guard.Requires<ArgumentNullException>(timer != null);
            Guard.Requires<ArgumentNullException>(progressbarService != null);
            Guard.Requires<ArgumentNullException>(configuration != null);

            graphConfig = new GraphConfig(configuration);

            Guard.Requires<ArgumentException>(graphConfig.IsValid, graphConfig.ErrorMsg);

			this.ViewModel = viewModel;
            ViewModel.Refresh.AfterExecute += new EventHandler(Refresh_AfterExecute);
            this.downloadStringService = downloadStringService;
            this.timer = timer;
            this.timer.Elapsed += new EventHandler(timer_Elapsed);
            this.progressbarService = progressbarService;

	        StartFetchingDataInBackground();

	        DownloadDataAndAddToViewModel();
		}
Exemplo n.º 5
0
        public TeamPictureViewModel(
            IRepository<DomainModel.TeamPicture.TeamPicture> teamPictureRepository, 
            IPersistDomainModelsAsync<DomainModel.TeamPicture.TeamPicture> teamPicturePersister, 
            ITimer refreshTimer, 
            IInvokeBackgroundWorker<IEnumerable<DomainModel.TeamPicture.TeamPicture>> backgroundWorker, 
            ILog log, 
            IWebcamService webcam, 
            IProgressbar progressbarService)
            : this()
        {
            _teamPictureRepository = teamPictureRepository;
            _teamPicturePersister = teamPicturePersister;
            _refreshTimer = refreshTimer;
            _backgroundWorker = backgroundWorker;
            _log = log;
        	_webcamService = webcam;
        	_webcamService.CaptureImageCompleted += ImageCapturedFromWebCam;
            _refreshTimer.Start(REFRESH_INTERVAL);
            _progressbarService = progressbarService;

            _refreshTimer.Elapsed += _refreshTimer_Elapsed;
            _teamPicturePersister.SaveCompleted += ConfigPersisterSaveCompleted;

            LoadDataFromDatabaseIntoViewModel();
        }
Exemplo n.º 6
0
        public TeamMembersController(
            TeamMembersViewModel teamMembersViewModel,
            TeamMembersSettingsViewModel teamMembersSettingsViewModel,
            IRepository<Userdb> userdbRepository,
            IRepository<Configuration> configRepo,
            IPersistDomainModelsAsync<Configuration> configPersister,
            IInvokeBackgroundWorker<IEnumerable<ProjectInfoServer>> asyncClient, 
            ILog logger,
            ITimer timer,
            IUIInvoker uiInvoker,
            IProgressbar loadingNotifier, IMetadataService metadataService)
            
        {
            Guard.Requires<ArgumentException>(userdbRepository != null, "userdbRepository");
            Guard.Requires<ArgumentException>(configRepo != null, "configRepository");
            Guard.Requires<ArgumentException>(configPersister != null, "configPersisterRepository");
            Guard.Requires<ArgumentException>(asyncClient != null, "asyncClient");
            Guard.Requires<ArgumentException>(logger != null, "logger");

            this.teamMembersViewModel = teamMembersViewModel;
            this.teamMembersSettingsViewModel = teamMembersSettingsViewModel;
            this.userdbRepository = userdbRepository;
            this.metadataService = metadataService;
            this.configRepository = configRepo;
            this.configPersisterRepository = configPersister;
            this.asyncClient = asyncClient;
            this.logger = logger;
            this.timer = timer;
            this.uiInvoker = uiInvoker;
            this.loadingNotifier = loadingNotifier;

            timer.Start(REFRESH_INTERVAL);
            timer.Elapsed += OnNotifiedToRefresh;
            teamMembersSettingsViewModel.Save.AfterExecute += (s, e) => OnSave();
            teamMembersSettingsViewModel.Refresh.AfterExecute += (s, e) => OnRefresh();
            teamMembersSettingsViewModel.PropertyChanged += PropertyChanged;
            configPersister.SaveCompleted += ConfigPersisterSaveCompleted;

            
            LoadConfig();
            LoadData();
        }
Exemplo n.º 7
0
        public TasksController(TasksViewModel viewModel,
                               IRepository<TaskDefinition> taskDefinitionRepository,
                               IRepository<TaskConfiguration> taskConfigurationRepository,
                               IPersistDomainModels<TaskConfiguration> domainModelPersister,
                               IUIInvoker uiInvoker, 
                               IProgressbar progressbar,
                               IInvokeBackgroundWorker<IEnumerable<TaskConfiguration>> asyncClient)
        {
            _viewModel = viewModel;

            _taskDefinitionRepository = taskDefinitionRepository;
            _taskConfigurationRepository = taskConfigurationRepository;
            _domainModelPersister = domainModelPersister;
            _uiInvoker = uiInvoker;
            _asyncClient = asyncClient;
            _progressbar = progressbar;

            _viewModel.SaveChanges.AfterExecute += SaveChanges;

        }
Exemplo n.º 8
0
		partial void OnSetProgressbarService(ref IProgressbar value);