Пример #1
0
        //add main window buttons functionality
        public void DayEvent(string nameStart)
        {
            AppView view = new AppView();

            List <string> notesNames  = Note.GetSearch(nameStart);
            List <string> mailsNames  = CustomMail.GetSearch(nameStart);
            List <string> eventsNames = MyEvent.GetSearch(nameStart);

            if (notesNames.Count != 0)
            {
                foreach (string name in notesNames)
                {
                    Note note = new Note(name);
                    view.ShowNoteDisplay(note);
                }
            }

            if (mailsNames.Count != 0)
            {
                foreach (string name in mailsNames)
                {
                    CustomMail mail = new CustomMail(name);
                    view.ShowMailDisplay(mail);
                }
            }

            if (eventsNames.Count != 0)
            {
                foreach (string name in eventsNames)
                {
                    MyEvent mevent = new MyEvent(name);
                    view.ShowEventDisplay(mevent);
                }
            }
        }
Пример #2
0
        public mainWindow()
        {
            main = this;
            InitializeComponent();
            MonthCombobox.SelectedIndex = AppView.GetCurMonthIndex();
            YearCombobox.Text           = AppView.GetCurrentYear();
            _view = new AppView();
            //MessageBox.Show(MonthCombobox.SelectionBoxItem.ToString()); YearTextbox.Text, MonthCombobox.SelectionBoxItem.ToString()
            _view.Start();
            _view.LoadCalendar(YearCombobox.Text, MonthCombobox.SelectionBoxItem.ToString());
            AppView.SetCurrentMonth(_view.GetMonths(), MonthCombobox);



            MonthCombobox.SelectionChanged += (o, e) => RefreshCalendar();
            YearCombobox.SelectionChanged  += (o, e) => RefreshCalendar();
        }