コード例 #1
0
        private void RibbonWindow_Loaded(object sender, RoutedEventArgs e)
        {
            // Populate year list with current year, previous 'x' years

            stPresenter = new StudentPresenter(this);

            //Load current year student list
            string now = DateTime.Now.Year.ToString();
            for (int i = 0; i < this.comboYear.Items.Count; i++)
            {
                ComboBoxItem x = (ComboBoxItem)this.comboYear.Items.GetItemAt(i);

                //FIXME: Only looking at the first year. Once Jan 01 2012 hits, it won't set to the current academic year.
                if (x.Content.ToString().Substring(0,4) == now)
                    this.comboYear.SelectedIndex = i;
            }
        }
コード例 #2
0
        private void RibbonWindow_Loaded(object sender, RoutedEventArgs e)
        {
            // Populate year list with current year, previous 'x' years


            stPresenter = new StudentPresenter(this);

            //Load current year student list
            string now = DateTime.Now.Year.ToString();

            for (int i = 0; i < this.comboYear.Items.Count; i++)
            {
                ComboBoxItem x = (ComboBoxItem)this.comboYear.Items.GetItemAt(i);

                //FIXME: Only looking at the first year. Once Jan 01 2012 hits, it won't set to the current academic year.
                if (x.Content.ToString().Substring(0, 4) == now)
                {
                    this.comboYear.SelectedIndex = i;
                }
            }
        }