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(); }
public GraphSettingsController(GraphSettings graphSettingsViewModel, GraphController graphController, Configuration configuration, IDownloadStringService downloadStringService, IPersistDomainModels<Configuration> configRepository) { Guard.Requires<ArgumentNullException>(graphSettingsViewModel != null); Guard.Requires<ArgumentNullException>(graphController != null); Guard.Requires<ArgumentNullException>(configuration != null); Guard.Requires<ArgumentNullException>(downloadStringService != null); Guard.Requires<ArgumentNullException>(configRepository != null); this.graphController = graphController; GraphSettingsViewModel = graphSettingsViewModel; GraphSettingsViewModel.Graph = GraphViewModel; GraphSettingsViewModel.PropertyChanged += ViewModel_PropertyChanged; GraphSettingsViewModel.Save.AfterExecute += ViewModel_Save_AfterExecute; GraphSettingsViewModel.Test.AfterExecute += ViewModel_Test_AfterExecute; graphSettingsViewModel.Cancel.AfterExecute += ViewModel_Cancel_AfterExecute; this.downloadStringService = downloadStringService; this.configRepository = configRepository; graphConfig = new GraphConfig(configuration); backupConfig = new GraphConfig(configuration.Clone() as Configuration); DownloadAndLoadDataIntoViewModel(); }
public WebDataService(IDownloadStringService downloadService) { this.downloadService = downloadService; }