Example #1
0
 public void SetIsPlayingAb(string name, Image i, string listname = "")
 {
     if (IsInList(name))
     {
         if (listname != "")
         {
             foreach (DuiBaseControl b in InnerDuiControl.FindControl(name))
             {
                 //System.Windows.Forms.MessageBox.Show(b.Tag.ToString());
                 if (b.Tag.ToString() == listname)
                 {
                     ((DuiPictureBox)b.FindControl("albumpic")[0]).BackgroundImage = i;
                 }
             }
         }
         else
         {
             DuiBaseControl b = InnerDuiControl.FindControl(name)[0];
             ((DuiPictureBox)b.FindControl("albumpic")[0]).BackgroundImage = i;
         }
     }
 }
Example #2
0
        public void SetIsPlaying(string name, string listname, int playing = 0)
        {
            if (IsInList(name))
            {
                foreach (DuiBaseControl b in InnerDuiControl.FindControl(name))
                {
                    if (b.Tag.ToString() == listname)
                    {
                        if (playing == -1)
                        {
                            ((DuiLabel)b.FindControl("infoforTimer")[0]).Text = "ζ–‡δ»ΆζŸε";
                            ((DuiLabel)b.FindControl("lbl")[0]).ForeColor     = Color.Red;
                        }
                        else if (playing == 1)
                        {
                            b.BackColor = Color.Transparent;
                            b.FindControl("albumpic")[0].Visible = true;
                            b.Height = 50;
                            b.FindControl("infoforsinger")[0].Location = new Point(60, 25);
                            DuiLabel lbl = (DuiLabel)b.FindControl("lbl")[0];
                            lbl.Location = new Point(65, 5);
                            lbl.Width    = 230;
                            lbl.Text     = lbl.Tag.ToString();
                            b.FindControl("btnpause")[0].Visible = true;
                            b.FindControl("btnplay")[0].Visible  = false;
                            b.FindControl("btndel")[0].Visible   = true;
                            b.BackColor   = Color.FromArgb(50, Color.White);
                            IsPlayingText = b.FindControl("lbl")[0].Tag.ToString();
                            IsPlayingList = b.Tag.ToString();
                            IsPlaying     = name;
                        }
                        else if (playing == 2)
                        {
                            b.FindControl("btnpause")[0].Visible = false;
                            b.FindControl("btnplay")[0].Visible  = true;
                        }
                        else if (playing == 3)
                        {
                            b.FindControl("btnpause")[0].Visible = true;
                            b.FindControl("btnplay")[0].Visible  = false;
                        }
                        else if (playing == 0)
                        {
                            b.BackColor = Color.Transparent;
                            b.FindControl("albumpic")[0].Visible = false;
                            b.Height = 25;
                            b.FindControl("infoforsinger")[0].Location = new Point(160, 4);
                            b.FindControl("lbl")[0].Location           = new Point(10, 4);
                            DuiLabel lbl = (DuiLabel)b.FindControl("lbl")[0];
                            lbl.Width = 160;
                            if (lbl.Tag.ToString().Length > 14)
                            {
                                lbl.Text = lbl.Tag.ToString().Remove(13).Insert(13, "...");
                            }
                            else
                            {
                                lbl.Text = lbl.Tag.ToString();
                            }

                            b.FindControl("btnpause")[0].Visible = false;
                            b.FindControl("btnplay")[0].Visible  = false;
                            b.FindControl("btndel")[0].Visible   = false;
                            b.BackColor   = Color.Transparent;
                            IsPlaying     = "";
                            IsPlayingText = "";
                            IsPlayingList = b.Tag.ToString();
                        }
                        RefreshList();
                    }
                }
            }
        }