コード例 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            grdMain.Background = DataUtilities.ChooseBackground(); //Randomly select background

            NameCityDict = CityUtilities.getNameCityDict();        // Get dictionary of City Name to City objects
            txtCity.Focus();
        }
コード例 #2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     grdMain.Background = DataUtilities.ChooseBackground(); //Randomly select background
     cmbUserType.Items.Add("General User");
     cmbUserType.Items.Add("Forecaster");
     txtUsername.Focus();
 }
コード例 #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (user.UserType == UserType.GeneralUser)
            {
                btnAddForecast.Visibility = Visibility.Hidden;
            }

            grdMain.Background = DataUtilities.ChooseBackground(); //Randomly select background
            codeCityDict = CityUtilities.getCityCodeDict(); //Get dictionary of City Codes to City Objects
            forecasts = DataUtilities.GetForecastsFromDB(); //Get forecasts from file
            populateListBox(); //Populate list box with cities

            //Set defaults
            lstCities.SelectedIndex = 0;
            dtpFrom.SelectedDate = DateTime.Now;
            dtpTo.SelectedDate = DateTime.Now;
        }
コード例 #4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            grdMain.Background = DataUtilities.ChooseBackground(); //Randomly select background
            NameCityDict       = CityUtilities.getNameCityDict();  //Get dictionary of City Names to City Objects
            cityCodeDict       = CityUtilities.getCityCodeDict();  //Get dictionary of City IDs to City Objects
            txtCity.Focus();

            //Pre load fields with values supplied from loaded forecast object
            txtCity.Text            = cityCodeDict[loadedForecast.CityID].ToString();
            lstCities.SelectedItem  = cityCodeDict[loadedForecast.CityID];
            lstCities.SelectedIndex = 0;
            dtpDate.SelectedDate    = loadedForecast.ForecastDate;
            sldMin.Value            = loadedForecast.MinimumTemp;
            sldMax.Value            = loadedForecast.MaximumTemp;
            sldWind.Value           = loadedForecast.WindSpeed;
            sldHumidity.Value       = loadedForecast.Humidity;
            sldPrecip.Value         = loadedForecast.Precipitation;
        }
コード例 #5
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     grdMain.Background = DataUtilities.ChooseBackground(); //Randomly select background
     loggedInUser       = new User();
     txtUsername.Focus();
 }