Exemplo n.º 1
0
        /// <summary>
        /// Updates the AvailableSearchChoices list with the options per the search category
        /// </summary>
        private void UseSelectedSearchCategory(EventRecipientsTypes searchCategory)
        {
            AvailableSearchChoices = CreateRecipientsList(searchCategory);

            // Use the first choice in the AvailableSearchChoices dictioanry as the default choice
            if (AvailableSearchChoices.Count > 0)
            {
                SelectedSearchChoice = AvailableSearchChoices.First().Key;
            }
        }
        /// <summary>
        /// Updates the AvailableSearchChoices list with the options per the search category
        /// </summary>
        /// <param name="category">The category to search by</param>
        private void UseSelectedSearchCategory(SearchCategory category)
        {
            // Check which category the search choice is from, and fill the LessonsTableData with the relevent lessons
            if (category == SearchCategory.Classes)
            {
                // Find the class that was chosen, and get its lessons
                AvailableSearchChoices = AvailableClasses;
            }
            else if (category == SearchCategory.Courses)
            {
                // Find the course that was chosen, and get its lessons
                AvailableSearchChoices = AvailableCourses;
            }
            else if (category == SearchCategory.Teachers)
            {
                AvailableSearchChoices = AvailableTeachers;
            }
            else
            {
                throw new ArgumentException("Couldn't use search category - unknown category type");
            }

            SelectedSearchChoice = AvailableSearchChoices.First().Key;
        }