コード例 #1
0
        public List <Album> CreateAlbumList()
        {
            List <Album>     albums     = new List <Album>();
            List <Music>     musics     = musicService.GetAll();
            HashSet <String> albumNames = new HashSet <String>();

            foreach (Music music in musics)
            {
                albumNames.Add(music.Album);
            }

            foreach (String albumName in albumNames)
            {
                List <Music> albumMusics = musicService.GetAllByAlbum(albumName);
                Album        album       = new Album(albumMusics[0].Album, albumMusics);
                albums.Add(album);
            }
            return(albums);
        }
コード例 #2
0
 public MusicEdit(Music music)
 {
     musicService  = new SimpleMusicService(new SimpleConnectionCreater());
     musicList     = musicService.GetAll();
     selectedMusic = music;
     InitializeComponent();
     this.DataContext = selectedMusic;
     InitComboBoxes();
     StartTimerAndPlayer();
 }
コード例 #3
0
        public async Task <IActionResult> index([FromQuery(Name = "includeMusicTypes")] bool includeMusicTypes = true, [FromQuery(Name = "includeAlbums")] bool includeAlbums = false, [FromQuery(Name = "isCoverPhoto")] bool isCoverPhoto = true)
        {
            try
            {
                _logger.LogInfo(ControllerContext.ActionDescriptor.DisplayName);
                var allMusicList = await _musicService.GetAll(includeMusicTypes, includeAlbums, isCoverPhoto);

                InfoLog($"{ControllerContext.ActionDescriptor.DisplayName} Total Music Count : {allMusicList.Result.Count()}");
                return(Ok(allMusicList));
            }
            catch (Exception exception)
            {
                return(ErrorInternal(exception, $"{ControllerContext.ActionDescriptor.DisplayName} Exception Message : {exception.Message} - {exception.InnerException}"));
            }
        }
コード例 #4
0
        public async Task <IActionResult> Tables(string seachString)
        {
            var music = from m in _context.musics
                        select m;
            var category = from a in _context.Categories
                           join b in _context.musics on a.Id equals b.CategoriesId
                           select new MusicView
            {
                Name       = b.Name,
                Categories = a.CateName,
                Single     = b.Single,
                Year       = b.Year
            };
            List <MusicView> list = await _musicService.GetAll(seachString);

            return(View(list));
        }
コード例 #5
0
        public MusicList(String arg)
        {
            musicSerice = new SimpleMusicService(new SimpleConnectionCreater());
            if (arg.Equals("All"))
            {
                listable = new ObservableCollection <Music>(musicSerice.GetAll());
            }
            InitializeComponent();
            musicList.ItemsSource = listable;
            if (Musics.selectedMusic != null)
            {
                selectedMusic = Musics.selectedMusic;
                selectedDockPanel.DataContext = selectedMusic;
            }


            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick    += timer_Tick;
            timer.Start();
        }