private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     _fileIOServices = new FileIOServices(Path);
     try
     {
         _todoData = _fileIOServices.LoadData();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         Close();
     }
     dgTodoList.ItemsSource = _todoData;
     _todoData.ListChanged += _todoData_ListChanged;
 }
Exemple #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            fileIOServece = new FileIOServices(PATH);

            try
            {
                todoDataList = fileIOServece.LoadData();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Close();
            }

            dgTodoList.ItemsSource    = todoDataList;
            todoDataList.ListChanged += TodoDataList_ListChanged;
        }
Exemple #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _fileIOServices = new FileIOServices(PATH);
            try
            {
                _todoDataList = _fileIOServices.LoadData();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Close();
            }

            dgToDoList.ItemsSource     = _todoDataList;
            dgTest.ItemsSource         = _todoDataList;
            dgToDoList.SelectedIndex   = -1;
            _todoDataList.ListChanged += _todoDataList_ListChanged;
        }
Exemple #4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _fileIOService = new FileIOServices(PATH);

            try
            {
                _todoDataList = _fileIOService.LoadData();
                if (1 != 0)
                {
                    Console.WriteLine("Eroooor");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Close();
            }



            dgTodoList.ItemsSource     = _todoDataList;
            _todoDataList.ListChanged += _todoDataList_ListChanged;
        }
Exemple #5
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _fileIOServices = new FileIOServices(PATH);
            try
            {
                _ToDoData = _fileIOServices.LoadData();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Close();
            }
            if (_ToDoData != null)
            {
                for (int i = 0; i < _ToDoData.Count(); i++)
                {
                    switch (_ToDoData[i].Day)
                    {
                    case 1:
                        _ToDoDataMonday.Add(_ToDoData[i]);
                        break;

                    case 2:
                        _ToDoDataTuesday.Add(_ToDoData[i]);
                        break;

                    case 3:
                        _ToDoDataWednesday.Add(_ToDoData[i]);
                        break;

                    case 4:
                        _ToDoDataThursday.Add(_ToDoData[i]);
                        break;

                    case 5:
                        _ToDoDataFriday.Add(_ToDoData[i]);
                        break;

                    default:
                        break;
                    }
                }
            }
            else
            {
                if (_ToDoDataMonday.Count == 0)
                {
                    _ToDoDataMonday.Add(new ToDoModel());
                    _ToDoDataMonday[0].Day = 1;
                    _ToDoDataMonday.Add(new ToDoModel());
                    _ToDoDataMonday[1].Day = 1;
                    _ToDoDataMonday.Add(new ToDoModel());
                    _ToDoDataMonday[2].Day = 1;
                }
                if (_ToDoDataTuesday.Count == 0)
                {
                    _ToDoDataTuesday.Add(new ToDoModel());
                    _ToDoDataTuesday[0].Day = 2;
                    _ToDoDataTuesday.Add(new ToDoModel());
                    _ToDoDataTuesday[1].Day = 2;
                    _ToDoDataTuesday.Add(new ToDoModel());
                    _ToDoDataTuesday[2].Day = 2;
                }
                if (_ToDoDataWednesday.Count == 0)
                {
                    _ToDoDataWednesday.Add(new ToDoModel());
                    _ToDoDataWednesday[0].Day = 3;
                    _ToDoDataWednesday.Add(new ToDoModel());
                    _ToDoDataWednesday[1].Day = 3;
                    _ToDoDataWednesday.Add(new ToDoModel());
                    _ToDoDataWednesday[2].Day = 3;
                }
                if (_ToDoDataThursday.Count == 0)
                {
                    _ToDoDataThursday.Add(new ToDoModel());
                    _ToDoDataThursday[0].Day = 4;
                    _ToDoDataThursday.Add(new ToDoModel());
                    _ToDoDataThursday[1].Day = 4;
                    _ToDoDataThursday.Add(new ToDoModel());
                    _ToDoDataThursday[2].Day = 4;
                }
                if (_ToDoDataFriday.Count == 0)
                {
                    _ToDoDataFriday.Add(new ToDoModel());
                    _ToDoDataFriday[0].Day = 5;
                    _ToDoDataFriday.Add(new ToDoModel());
                    _ToDoDataFriday[1].Day = 5;
                    _ToDoDataFriday.Add(new ToDoModel());
                    _ToDoDataFriday[2].Day = 5;
                }
            }
            dgToDoListMonday.ItemsSource    = _ToDoDataMonday;
            dgToDoListTuesday.ItemsSource   = _ToDoDataTuesday;
            dgToDoListWednesday.ItemsSource = _ToDoDataWednesday;
            dgToDoListThursday.ItemsSource  = _ToDoDataThursday;
            dgToDoListFriday.ItemsSource    = _ToDoDataFriday;
        }