public MusicItem FindItemByNameOnline(string a, string listname) { MusicListItem m = FindGroup(listname); MusicItem ix = null; foreach (MusicItem i1 in m.musics) { if (i1.Name == a) { ix = i1; } } return(ix); }
private void Listx_MouseUp(object sender, DuiMouseEventArgs e) { t1.Stop(); moveing = false; //moveto(((DuiBaseControl)sender), oldtop); //System.Windows.Forms.MessageBox.Show(movec.ToString()); if (movec > 25 || movec < -25) { int b = (int)(((double)movec - 12) / 25); int c = Math.Abs((int)(((double)movec - 12) / 25)); //System.Windows.Forms.MessageBox.Show(c.ToString()); int d = (Items.IndexOf((DuiBaseControl)sender) + b + 1); //System.Windows.Forms.MessageBox.Show(d.ToString()); if (d > 0 && d < Items.Count && c > 0) { MusicListItem m = FindGroup(((DuiBaseControl)sender).Tag.ToString()); DuiBaseControl m2 = FindGroupEx(((DuiBaseControl)sender).Tag.ToString()); MusicItem m1 = null; foreach (MusicItem ic in m.musics) { if (ic.Path == ((DuiBaseControl)sender).Name || ic.URL == ((DuiBaseControl)sender).Name) { m1 = ic; } } int f = m.musics.IndexOf(m1) + b + 1; //System.Windows.Forms.MessageBox.Show(m.musics.IndexOf(m1)+"\n"+b+"\n" + f.ToString()); if (f > 0 && f < m.musics.Count) { DuiBaseControl m0 = (DuiBaseControl)sender; Items.Remove(m0); Items.Insert(d, m0); RefreshList(); m.musics.Remove(m1); m.musics.Insert(f, m1); } } } Cursor = System.Windows.Forms.Cursors.Default; }
// GET: Music public ActionResult Index() { var model = new MusicListItem[0]; return(View(model)); }
public bool AddList(string name) { bool Searched = false; foreach (MusicListItem a in Groups) { if (a.Name == "list_" + name) { Searched = true; } else { Searched = false; } } if (!Searched) { DuiBaseControl b = new DuiBaseControl(); b.Name = "list_" + name; b.Size = new Size(Width, 35); b.BackColor = Color.Transparent; b.Tag = "List"; Borders b1 = new Borders(b); b1.BottomWidth = 1; b1.BottomColor = Color.FromArgb(50, 0, 0, 0); b.Borders = b1; DuiLabel l = new DuiLabel(); l.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; l.Location = new Point(30, 8); l.AutoSize = true; l.Font = new Font("微软雅黑", 11F, FontStyle.Bold); l.ForeColor = Color.White; l.Text = name; l.Name = "name"; DuiLabel l2 = new DuiLabel(); l2.Name = "Count"; if (name == "我喜欢") { l2.Location = new Point(l.Width + 43, 11); } else { l2.Location = new Point(l.Width + 25, 11); } l2.AutoSize = true; l2.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; l2.Font = new Font("微软雅黑", 9F); l2.ForeColor = Color.White; l2.Text = "[列表无歌曲,可直接把歌曲拖到这里来哦]"; l2.Tag = (Items.Count + 1).ToString(); DuiButton btn = new DuiButton(); btn.Size = new Size(22, 22); btn.Location = new Point(b.Width - 35, 8); btn.NormalImage = Properties.Resources.btn_list_menu_n; btn.HoverImage = Properties.Resources.btn_list_menu_h; btn.PressedImage = Properties.Resources.btn_list_menu_p; btn.MouseClick += Btn_MouseClick; btn.Tag = name; DuiPictureBox ilike = new DuiPictureBox(); if (name == "我喜欢") { ilike.Size = new Size(22, 22); ilike.Location = new Point(78, 8); ilike.Image = Properties.Resources.btn_iliked_p; } btn.Tag = name; DuiPictureBox more = new DuiPictureBox(); more.Size = new Size(23, 23); more.Location = new Point(10, 7); if (name == "默认列表") { more.Image = Properties.Resources.btn_more_close; more.Tag = "Open"; } else { more.Image = Properties.Resources.btn_more_open; more.Tag = "Close"; } more.MouseClick += More_MouseClick; more.Name = "more"; DuiTextBox tb = new DuiTextBox(); tb.Size = new Size(100, 22); tb.Location = new Point(31, 9); tb.Visible = false; tb.Name = "tb"; tb.ForeColor = Color.White; tb.FocusedChanged += Tb_FocusedChanged; tb.KeyDown += Tb_KeyDown; tb.Font = new Font("微软雅黑", 9F); b.Controls.Add(tb); b.Controls.Add(btn); b.Controls.Add(l); b.Controls.Add(l2); b.Controls.Add(more); if (name == "我喜欢") { b.Controls.Add(ilike); } b.MouseDoubleClick += B_MouseDoubleClick; Items.Add(b); RefreshList(); MusicListItem m = new MusicListItem(name, new List <MusicItem>()); Groups.Add(m); } GC.Collect(); return(!Searched); }