Exemplo n.º 1
0
 private void MonthMinusOne(object sender, RoutedEventArgs e)
 {
     if (ShownMonth.Year == 1)
     {
         ShownMonth.AddYears(-1);
     }
     ShownMonth = ShownMonth.AddMonths(-1);
     datesInMonth();
     UserViewModel.SetCurrentShownMonth();
     MonthShownTextBox.Text = ShownMonth.Month.ToString();
     YearShownTextBox.Text  = ShownMonth.Year.ToString();
 }
Exemplo n.º 2
0
 private void MonthShownTextBox_OnTextChanged(object sender, TextChangedEventArgs e)
 {
     if (MonthShownTextBox.Text != String.Empty)
     {
         if (ListOfPossibleMonths.Contains(Int32.Parse(MonthShownTextBox.Text)))
         {
             ShownMonth = ShownMonth.AddMonths(-ShownMonth.Month);
             ShownMonth = ShownMonth.AddMonths(Int32.Parse(MonthShownTextBox.Text));
             FixHubTestAcitivities(sender, e);
             datesInMonth();
             MonthYearError.Text = "";
         }
         else
         {
             MonthYearError.Text = "Måneden er ikke inden for Kalenders rækkevidde";
         }
     }
 }
Exemplo n.º 3
0
 private void YearShownTextBox_OnTextChanged(object sender, TextChangedEventArgs e)
 {
     if (YearShownTextBox.Text != String.Empty)
     {
         if (Int32.Parse(YearShownTextBox.Text) >= 2000 && Int32.Parse(YearShownTextBox.Text) <= 2100)
         {
             if (ListOfPossibleYears.Contains(Int32.Parse(YearShownTextBox.Text)))
             {
                 ShownMonth = ShownMonth.AddYears(-ShownMonth.Year + 1);
                 ShownMonth = ShownMonth.AddYears(Int32.Parse(YearShownTextBox.Text) - 1);
                 datesInMonth();
                 MonthYearError.Text = "";
             }
         }
         else
         {
             MonthYearError.Text = "Året er ikke inden for Kalenders rækkevidde";
         }
     }
 }