Exemple #1
0
        //determines when an assigment is added to the list
        public static async Task NewAssignmentAdded()
        {
            //I have the old list, get a new list and compare sizes
            List <Assignment> refreshedTasks = await StudentInfoHandler.GetTodolist().ConfigureAwait(false);

            List <Assignment> newTasks = new List <Assignment>();

            //if there is a change grab the assignment that was last added to the list

            if (currentList.Count != refreshedTasks.Count)
            {
                foreach (Assignment item in refreshedTasks)
                {
                    if (!currentList.Contains(item))
                    {
                        newTasks.Add(item);
                    }
                }
                isUpdateable = true;
            }

            refreshedList = refreshedTasks;

            if (newTasks.Count != 0)
            {
                NotificationBalloonTips.NewAssignmentPopUp(newTasks);
            }
        }
        private void MainWindow_Closing(object sender, CancelEventArgs e)
        {
            if (!_isExit)
            {
                e.Cancel = true;
                main.Hide();

                NotificationBalloonTips.StartPopUp();
            }
        }
Exemple #3
0
        //determines when a assignment is late
        public static void IsAssignmentGonnaBeLate()
        {
            List <Assignment> needSubmission = new List <Assignment>();

            DateTime dateTime;

            foreach (Assignment task in currentList)
            {
                dateTime = Convert.ToDateTime(task.Due_at);

                if (DateTime.Now.AddHours(1) > dateTime)
                {
                    needSubmission.Add(task);
                }
            }

            if (needSubmission.Count != 0)
            {
                NotificationBalloonTips.WarningPopUp(needSubmission);
            }
        }