예제 #1
0
        public MainWindow()
        {
            InitializeComponent();
            reminder = new RemindManager();
            reminder.RemindsFinded += Reminder_RemindsFinded;
            try
            {
                reminder.LoadFiles();
                reminder.FindActiveRemind();
            }
            catch (MyExeption ex)
            {
                MessageBox.Show(ex.Message);
            }

            current_reminds_list.ItemsSource       = reminder.CurrentReminds;
            current_reminds_list.DisplayMemberPath = "Title";
            past_reminds_list.ItemsSource          = reminder.CompletedReminds;
            past_reminds_list.DisplayMemberPath    = "Title";

            delete_remind.IsEnabled           = false;
            edit_remind.IsEnabled             = false;
            delete_completed_remind.IsEnabled = false;
            reestablish_remind.IsEnabled      = false;
        }
 public ShowActiveRemind(RemindManager reminder, Remind remind)
 {
     InitializeComponent();
     _reminder                  = reminder;
     _remind                    = remind;
     remind_title.Text          = remind.Title;
     remind_discription.Text    = remind.Discription;
     remind_date.Text           = remind.Date.ToLongDateString() + "  " + remind.Date.ToShortTimeString();
     delayed_time.SelectedIndex = 0;
 }
예제 #3
0
 public AddRemind(Remind remind, RemindManager reminder, bool delay_remind = false)
 {
     // constructor for edit remind
     InitializeComponent();
     _reminder      = reminder;
     _remind        = remind;
     _delay_remind  = delay_remind;
     this.Title     = "Редактировать";
     btn_ok.Content = "Редактировать";
     if (_delay_remind == true)
     {
         btn_cancel.Content = "Завершить";
     }
     remind_title.Focus();
     one_day.IsChecked         = true;
     timetable_group.IsEnabled = false;
     for (int i = 0; i < 60; i++)
     {
         if (i < 10)
         {
             minute_value.Items.Add(String.Format("0{0}", i));
         }
         else
         {
             minute_value.Items.Add(i.ToString());
         }
     }
     hour_value.SelectedIndex = DateTime.Now.Hour;
     for (int i = 0; i < 24; i++)
     {
         if (i < 10)
         {
             hour_value.Items.Add(String.Format("0{0}", i));
         }
         else
         {
             hour_value.Items.Add(i.ToString());
         }
     }
     minute_value.SelectedIndex = DateTime.Now.Minute;
     minute_value.Focus();
     date_picker.SelectedDate = DateTime.Now;
     remind_title.Text        = remind.Title;
     remind_discription.Text  = remind.Discription;
 }
예제 #4
0
 public AddRemind(RemindManager reminder)
 {
     // constructor for add a new remind
     InitializeComponent();
     _reminder  = reminder;
     this.Title = "Новое напоминание";
     remind_title.Focus();
     one_day.IsChecked         = true;
     timetable_group.IsEnabled = false;
     //
     for (int i = 0; i < 60; i++)
     {
         if (i < 10)
         {
             minute_value.Items.Add(String.Format("0{0}", i));
         }
         else
         {
             minute_value.Items.Add(i.ToString());
         }
     }
     hour_value.SelectedIndex = DateTime.Now.Hour;
     for (int i = 0; i < 24; i++)
     {
         if (i < 10)
         {
             hour_value.Items.Add(String.Format("0{0}", i));
         }
         else
         {
             hour_value.Items.Add(i.ToString());
         }
     }
     minute_value.SelectedIndex = DateTime.Now.Minute;
     date_picker.SelectedDate   = DateTime.Now;
 }