コード例 #1
0
        private void FillOrRefreshPlaylistsGridView()
        {
            var playlists = PlaylistsRepo.GetAll(_currentUser.UserId).ToList();

            playlists.Add(new Playlist
            {
                PlaylistName = "Загруженные мною"
            });
            playlists = playlists.OrderBy(x => x.PlaylistId).ToList();
            PlaylistsDataGridView.DataSource            = playlists;
            PlaylistsDataGridView.Columns[0].Visible    = false;
            PlaylistsDataGridView.Columns[1].HeaderText = "Плейлисты";
            PlaylistsDataGridView.Columns[2].Visible    = false;
            PlaylistsDataGridView.Columns[3].Visible    = false;
            PlaylistsDataGridView.Columns[4].Visible    = false;
        }
コード例 #2
0
        public MusicTrackForm(MusicTrack musicTrack)
        {
            InitializeComponent();

            _musicTrack = musicTrack;

            TrackNameTxtBox.TextChanged   += ResetBackground;
            TrackAuthorTxtBox.TextChanged += ResetBackground;
            GenreCmbBox.TextChanged       += ResetBackground;
            PlaylistCmbBox.TextChanged    += ResetBackground;

            TrackNameTxtBox.Text      = _musicTrack.TrackName;
            TrackAuthorTxtBox.Text    = _musicTrack.TrackAuthor;
            GenreCmbBox.DataSource    = GenresRepo.GetAll();
            PlaylistCmbBox.DataSource = PlaylistsRepo.GetAll(_musicTrack.UploadUserId);

            GenreCmbBox.DisplayMember = "GenreName";
            GenreCmbBox.ValueMember   = "GenreId";

            PlaylistCmbBox.DisplayMember = "PlaylistName";
            PlaylistCmbBox.ValueMember   = "PlaylistId";
        }