Exemplo n.º 1
0
        //АЛЬБОМЫ
        private void Albums()
        {
            DisposeViewControls();

              albumControl = new ViewAlbumControl()
              {
            Width = ViewWidth,
            Height = ViewHeigth,
            AutoScroll = autoScroll,
            Location = location
              };

              albumControl.dateTimePicker1.Value = DateTimePicker.MinimumDateTime;
              albumControl.dateTimePicker2.Value = DateTimePicker.MaximumDateTime;

              albumControl.FindBtn.Click += delegate (object sender1, EventArgs e1)
              {
            albumlist = db.Albums.Where(p =>
            p.Name.Contains(albumControl.textBox1.Text)
            && p.Year > albumControl.dateTimePicker1.Value
            && p.Year < albumControl.dateTimePicker2.Value
            ).ToList();
            Albums();
              };

              int i = 0;
              int pos = startRowPosition;
              foreach(Album item in albumlist)
              {
            RowControl row = new RowControl
              (
              item.Name,
              item.Year.Date.ToShortDateString(),
              item.Artist.ToString(),
              item.Genre.ToString()
              );

            //row.panel1.Visible = true;
            //row.panel1.Click += delegate (object sender0, EventArgs e0)
            //{
            //  //изменить фон на "Share"
            //  //string url = "https://api.vk.com/wall.post?message=" + "(тест WHY_music, шеринг вк)";
            //  string url = "https://vk.com/feed?w=postbox?"
            //  Process.Start(url);
            //};

            row.Name = "r_" + i.ToString();
            row.Location = new Point(rowPaddingLeft, pos);
            row.DoubleClick += delegate (object sender2, EventArgs e2)
            {
              tracklist = db.Tracks.Where(p => p.AlbumId == item.Id).ToList();
              Track();
            };
            i++;
            pos += interval;

            albumControl.Controls.Add(row);
              }
              Controls.Add(albumControl);
        }
Exemplo n.º 2
0
        //ЖАНРЫ
        void Genre()
        {
            DisposeViewControls();

              genreControl = new ViewGenreControl()
              {
            Width = ViewWidth,
            Height = ViewHeigth,
            AutoScroll = autoScroll,
            Location = location
              };

              genreControl.FindBtn.Click += delegate (object sender1, EventArgs e1)
              {
            genrelist = db.Genres.Where(p => p.Name.Contains(genreControl.textBox1.Text)).ToList();
            Genre();
              };

              int i = 0;
              int pos = startRowPosition;
              foreach(Genre item in genrelist)
              {
            RowControl row = new RowControl
              (
              item.Name,
              "", "", ""
              );
            row.Name = "r_" + i.ToString();
            row.Location = new Point(rowPaddingLeft, pos);
            row.DoubleClick += delegate (object sender2, EventArgs e2)
            {
              albumlist = db.Albums.Where(p => p.GenreId == item.Id).ToList();
              Albums();
            };
            i++;
            pos += interval;

            genreControl.Controls.Add(row);
              }
              Controls.Add(genreControl);
        }
Exemplo n.º 3
0
        //ТРЕКИ
        void Track()
        {
            DisposeViewControls();

              trackControl = new ViewGenreControl()
              {
            Width = ViewWidth,
            Height = ViewHeigth,
            AutoScroll = autoScroll,
            Location = location
              };

              trackControl.FindBtn.Click += delegate (object sender1, EventArgs e1)
              {
            tracklist = db.Tracks.Where(p => p.Name.Contains(trackControl.textBox1.Text)).ToList();
            Track();
              };

              int i = 0;
              int pos = startRowPosition;
              foreach(Track item in tracklist)
              {
            RowControl row = new RowControl
              (
              item.Name,
              item.Length.ToString(),
              item.Number.ToString(),
              item.Album.ToString()
              );

            row.Name = "r_" + i.ToString();
            row.Location = new Point(rowPaddingLeft, pos);
            row.DoubleClick += delegate (object sender2, EventArgs e2)
            {
              MessageBoxButtons buttons = MessageBoxButtons.YesNo;
              DialogResult result = MessageBox.Show("Открыть браузер для поиска песни Вконтакте?", "confirm", buttons);

              if(result == DialogResult.Yes)
              {
            string url = "https://vk.com/search?c[q]=" + item.Name + "&c%5Bsection%5D=audio";
            Process.Start(url);
              }

            };
            i++;
            pos += interval;

            trackControl.Controls.Add(row);
              }
              Controls.Add(trackControl);
        }
Exemplo n.º 4
0
        //ИСПОЛНИТЕЛИ
        private void Artists()
        {
            DisposeViewControls();

              artistControl = new ViewArtistControl()
              {
            Width = ViewWidth,
            Height = ViewHeigth,
            AutoScroll = autoScroll,
            Location = location
              };

              artistControl.dateTimePicker1.Value = DateTimePicker.MinimumDateTime;
              artistControl.dateTimePicker2.Value = DateTimePicker.MaximumDateTime;

              artistControl.FindBtn.Click += delegate (object sender1, EventArgs e1)
              {
            artistlist = db.Artists.Where(p =>
            p.Name.Contains(artistControl.textBox1.Text)
            && p.BirthDate > artistControl.dateTimePicker1.Value
            && p.BirthDate < artistControl.dateTimePicker2.Value
            //.Union(db.Phones.Where(p=>p.Name.Contains("Samsung")));
            //&& p.Country.Contains(artistControl.comboBox1.SelectedValue.ToString())
            ).ToList();
            Artists();
              };

              int i = 0;
              int pos = startRowPosition;
              foreach(Artist item in artistlist)
              {
            RowControl row = new RowControl
              (
              item.Name,
              item.BirthDate.Date.ToShortDateString(),
              item.Country,
              ""
              );
            row.panel1.Visible = true;
            row.panel1.Click += delegate (object sender0, EventArgs e0)
            {
              DisposeViewControls();
              artistview = new ArtistView()
              {
            Width = ViewWidth,
            Height = ViewHeigth,
            Location = location
              };

              artistview._artist.Text = item.Name;
              artistview._country.Text = item.Country;
              artistview._date.Text = item.BirthDate.Date.ToShortDateString();
              artistview._site.Text = item.WebSiteLink;
              artistview._youtube.Text = item.YouTubeChannel;
              artistview._fan.Text = item.FunClubLink;

              artistview.button1.Click += delegate (object sender4, EventArgs e4)
              {
            MessageBoxButtons buttons = MessageBoxButtons.YesNo;
            DialogResult result = MessageBox.Show("Открыть браузер для поиска новостей по исполнителю " + item.Name + " ?", "confirm", buttons);

            if(result == DialogResult.Yes)
            {
              string url = "http://google.com/#newwindow=1&q=" + item.Name + "&newwindow=1&tbm=nws";
              Process.Start(url);
            }
              };
              artistview.panel1.Click += delegate (object sender3, EventArgs e3) { Artists(); };
              Controls.Add(artistview);
            };
            row.Name = "r_" + i.ToString();
            row.Location = new Point(rowPaddingLeft, pos);
            row.DoubleClick += delegate (object sender2, EventArgs e2)
            {
              albumlist = db.Albums.Where(p => p.ArtistId == item.Id).ToList();
              Albums();
            };
            i++;
            pos += interval;

            artistControl.Controls.Add(row);
              }
              Controls.Add(artistControl);
        }