Business.EditPlaylistBusiness.GetRatingCategoriesAsync C# (CSharp) Метод

GetRatingCategoriesAsync() публичный Метод

Loads the list of rating categories for the search interface.
public GetRatingCategoriesAsync ( bool addSpecial ) : Task>
addSpecial bool
Результат Task>
        public async Task<List<RatingCategory>> GetRatingCategoriesAsync(bool addSpecial) {
            List<RatingCategory> Result = await Task.Run(() => SearchVideoAccess.GetCustomRatingCategories());
            Result.Insert(0, new RatingCategory() { Name = "--------------------" });
            Result.Insert(0, new RatingCategory() { Name = "Love" });
            Result.Insert(0, new RatingCategory() { Name = "Egoless" });
            Result.Insert(0, new RatingCategory() { Name = "Spiritual Feminine" });
            Result.Insert(0, new RatingCategory() { Name = "Spiritual Masculine" });
            Result.Insert(0, new RatingCategory() { Name = "Emotional Feminine" });
            Result.Insert(0, new RatingCategory() { Name = "Emotional Masculine" });
            Result.Insert(0, new RatingCategory() { Name = "Physical Feminine" });
            Result.Insert(0, new RatingCategory() { Name = "Physical Masculine" });
            Result.Insert(0, new RatingCategory() { Name = "Intensity" });
            if (addSpecial) {
                Result.Insert(0, new RatingCategory() { Name = "--------------------" });
                Result.Insert(0, new RatingCategory() { Name = "Height" });
                Result.Insert(0, new RatingCategory() { Name = "Length" });
                Result.Insert(0, new RatingCategory() { Name = "Highest" });
                Result.Insert(0, new RatingCategory() { Name = "Preference" });
            }
            Result.Insert(0, new RatingCategory());
            return Result;
        }

Usage Example

 private async void Window_Loaded(object sender, RoutedEventArgs e) {
     this.DataContext = settings;
     EditPlaylistBusiness business = new EditPlaylistBusiness();
     RatingCategoryCombo.ItemsSource = await business.GetRatingCategoriesAsync(false);
 }