Exemplo n.º 1
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.º 2
0
            public void Setup()
            {
                graphConfig =new GraphConfig(GraphConfig.NewDefaultConfiguration());
                graphConfig.Database = "Webshop";
                graphConfig.Collection = "ordersPrDay";
                graphConfig.MaxNumberOfDataPoints = 3;
                graphConfig.XAxisProperty = "Date";
                graphConfig.YAxisProperty = "NumberOfSales";
                graphConfig.IsConfigured = true;

                downloadStringServiceFake = new Mock<IDownloadStringService>();
                graph = new Graph();
                timerFake = new Mock<ITimer>();
                progressBarServiceFake = new Mock<IProgressbar>();

                Before();
            }
Exemplo n.º 3
0
		public GraphSettings()
		{
			Databases = new ObservableCollection<DatabaseViewModel>();
			SelectedDatabase = new DatabaseViewModel();
			SelectedCollection = new CollectionViewModel();
			AvailableProperties = new ObservableCollection<string>();
						Graph = new Graph();
	
			Save = new DelegateCommand();
			Refresh = new DelegateCommand();
			Test = new DelegateCommand();
			Cancel = new DelegateCommand();
		
			ApplyDefaultConventions();
		}