private void FillListView(StretchingRoutine stretchingRoutine)
        {
            ResetControls();

            int           groupIndex, itemIndex;
            ListViewGroup group;
            ListViewItem  item;

            foreach (OneDaySession session in stretchingRoutine.SessionsList)
            {
                group = new ListViewGroup(session.SessionName + "(" + session.Day + ")", HorizontalAlignment.Left);
                ExercisesListView.Groups.Add(group);
                groupIndex = ExercisesListView.Groups.IndexOf(group);

                foreach (StretchingExercise exercise in session.ExercisesList)
                {
                    item = new ListViewItem(exercise.ExerciseName);
                    item.SubItems.Add(exercise.Sets.ToString());
                    item.SubItems.Add(exercise.Rest.ToLongTimeString());
                    ExercisesListView.Items.Add(item);
                    itemIndex = ExercisesListView.Items.IndexOf(item);
                    ExercisesListView.Items[itemIndex].Group = ExercisesListView.Groups[groupIndex];
                }
            }
        }
        public void ShowRoutine()
        {
            ResetControls();

            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = RoutineManager.routineDirectoryPath;
            openFileDialog.Title            = "Open routine";

            DialogResult dialogResult = openFileDialog.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                try
                {
                    StretchingRoutine stretchingRoutine = RoutineManager.LoadStretchingtRoutine(openFileDialog.FileName);
                    MessageBox.Show("Stretching routine (" + stretchingRoutine.RoutineName + ") was opened succesfully.");
                    FillListView(stretchingRoutine);

                    stretchingRoutine.UpdateRoutine();
                    TotalExercisesLabel.Text = "Total Exercises: " + stretchingRoutine.TotalExercises;
                    TotalSetsLabel.Text      = "Total Sets: " + stretchingRoutine.TotalSets;
                    StartLabel.Text          = "Start: " + stretchingRoutine.Start.ToShortDateString();
                    if (stretchingRoutine.Duration.TotalDays >= 2)
                    {
                        DurationLabel.Text = "Duration: " + stretchingRoutine.Duration.TotalDays.ToString("F0") + " days";
                    }
                    else
                    {
                        DurationLabel.Text = "Duration: " + stretchingRoutine.Duration.TotalDays.ToString("F0") + " day";
                    }
                }
                catch (InvalidCastException)
                {
                    MessageBox.Show("Select the proper stretching routine.");
                }
            }
        }