Exemple #1
0
        /// <summary>
        /// 播放按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_Download_MouseClick(object sender, DuiMouseEventArgs e)
        {
            //播放视频
            DuiButton dbn = sender as DuiButton;

            Entity.MovieListEntity.DataItem moveInfo = new Entity.MovieListEntity.DataItem();
            if (dbn.Tag != null)
            {
                moveInfo = dbn.Tag as Entity.MovieListEntity.DataItem;
            }
            string url = "";

            try
            {
                API.TvAPI             tva  = new API.TvAPI();
                Entity.MovePlayEntity plav = tva.getVideoUrl(userEntity.email, userEntity.psw, moveInfo.videoID.ToString(), "all", userEntity.imei);
                Console.WriteLine(plav.toJsonString());
                Console.WriteLine(plav.data);
                PlayerForm plF = new PlayerForm();
                url        = plav.data.ToString();
                plF.tvUrl  = plav.data.ToString();
                plF.tvName = moveInfo.videoName;
                plF.Show();
                plF.AxPlayer_PlayOrPause(url);
            }
            catch (Exception ex)
            {
                Logger.Singleton.Error("name:" + moveInfo.videoName + "---地址:" + url, ex);
                throw;
            }
        }
Exemple #2
0
 /// <summary>
 /// 搜索按钮事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Btn_search_MouseClick(object sender, DuiMouseEventArgs e)
 {
     foreach (var item in BaseControl_Search.DUIControls)
     {
         if (item is DuiButton)
         {
             DuiButton btn_search = item as DuiButton;
             foreach (var citem in btn_search.Controls)
             {
                 if (citem is DuiTextBox)
                 {
                     DuiTextBox searchText = citem as DuiTextBox;
                     if (!string.IsNullOrEmpty(searchText.Text) && searchText.Text != "输入关键字进行搜索")
                     {
                         isSearch            = true;
                         startNo             = "1";
                         userEntity.menuName = searchText.Text;
                         Thread thread = new Thread(() => updateImgList(searchText.Text, startNo));
                         thread.Start();
                     }
                     else
                     {
                         MessageForm mf = new MessageForm("请输入关键字进行搜索");
                         mf.ShowDialog();
                     }
                 }
             }
         }
     }
 }
Exemple #3
0
        private void BtnPlayControl_MouseClick(object sender, DuiMouseEventArgs e)
        {
            DuiButton mbu = sender as DuiButton;

            switch (mbu.Name)
            {
            case "btnStop":    //停止按钮
                lw.axPlayer.Close();
                lw.Hide();
                BaseControl.BackColor       = defaultSkinColor;
                BaseControl.BackgroundImage = Properties.Resources._5;
                Thread thread = new Thread(() => convertCacheFileToOther());
                thread.Start();
                break;

            case "btnPrev":    //上一个

                break;

            case "btnPlay":    //播放或暂停
                AxPlayer_PlayOrPause(tvUrl);
                break;

            case "btnNext":    //下一个

                break;

            case "btnOpenFile":    //打开文件

                break;

            case "btnVolume":    //静音

                break;

            case "btnScreenShot":    //截图

                break;

            case "btnFullScreen":    //全屏
                fullScreen();
                break;

            case "btnList":    //列表
                isShowList();
                break;

            default:
                break;
            }
        }
Exemple #4
0
        /// <summary>
        /// 收藏按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_Sc_MouseClick(object sender, DuiMouseEventArgs e)
        {
            DuiButton btn = sender as DuiButton;

            if (btn.Tag.ToString().Split('|')[0].ToString() == "收藏")
            {
                btn.BackgroundImage = Properties.Resources.sc1;
                btn.Tag             = "取消收藏|" + btn.Tag.ToString().Split('|')[1].ToString();
            }
            else
            {
                btn.BackgroundImage = Properties.Resources.sc0;
                btn.Tag             = "收藏|" + btn.Tag.ToString().Split('|')[1].ToString();
            }
        }
Exemple #5
0
        private void Control_MouseMove(object sender, MouseEventArgs e)
        {
            Size thisZ = new Size();

            if (sender is LayeredPanel)
            {
                LayeredPanel lpn = sender as LayeredPanel;
                thisZ = lpn.Size;
            }
            else if (sender is DuiButton)
            {
                DuiButton btn_Resize = sender as DuiButton;
                thisZ = btn_Resize.Size;
            }
            else if (sender is LayeredBaseControl)
            {
                LayeredBaseControl lns = sender as LayeredBaseControl;
                thisZ = lns.Size;
            }
            //鼠标移动过程中,坐标时刻在改变
            //当鼠标移动时横坐标距离窗体右边缘5像素以内且纵坐标距离下边缘也在5像素以内时,要将光标变为倾斜的箭头形状,同时拖拽方向direction置为MouseDirection.Declining
            //(e.Location.X <= 5 && e.Location.Y <= 5) || (e.Location.X >= thisZ.Width - 5 && e.Location.Y <= 5) || (e.Location.X <= 4 && e.Location.Y >= thisZ.Height - 5)
            if ((e.Location.X >= thisZ.Width - 5 && e.Location.Y >= thisZ.Height - 5))
            {
                this.Cursor = Cursors.SizeNWSE;
                direction   = MouseDirection.Declining;
            }
            ////当鼠标移动时横坐标距离窗体右边缘5像素以内时,要将光标变为倾斜的箭头形状,同时拖拽方向direction置为MouseDirection.Herizontal
            //else if (e.Location.X <= 5 || e.Location.X >= thisZ.Width - 5)
            //{
            //    this.Cursor = Cursors.SizeWE;
            //    direction = MouseDirection.Herizontal;
            //}
            ////同理当鼠标移动时纵坐标距离窗体下边缘5像素以内时,要将光标变为倾斜的箭头形状,同时拖拽方向direction置为MouseDirection.Vertical
            //else if (e.Location.Y <= 5 || e.Location.Y >= thisZ.Height - 5)
            //{
            //    this.Cursor = Cursors.SizeNS;
            //    direction = MouseDirection.Vertical;

            //}
            //否则,以外的窗体区域,鼠标星座均为单向箭头(默认)
            else
            {
                this.Cursor = Cursors.Arrow;
            }
            //设定好方向后,调用下面方法,改变窗体大小
            ResizeWindow();
        }
Exemple #6
0
        /// <summary>
        /// 下载按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_Download_MouseClick(object sender, DuiMouseEventArgs e)
        {
            //下载文件
            DuiButton dbn      = sender as DuiButton;
            string    url      = dbn.Tag.ToString().Split('|')[1].ToString();
            string    fileName = "";

            if (dbn.Name.Contains("btn_Setting_"))
            {
                if (string.IsNullOrEmpty(pes.CachePath))
                {
                    fileName = AppDomain.CurrentDomain.BaseDirectory + @"CacheWallpaper\";
                }
                else
                {
                    fileName = pes.CachePath.Replace("\\CacheWallpaper", "") + @"CacheWallpaper\";
                }
            }
            else
            {
                if (string.IsNullOrEmpty(pes.DownloadPath))
                {
                    fileName = AppDomain.CurrentDomain.BaseDirectory + @"ImageWallpaper\";
                }
                else
                {
                    fileName = pes.DownloadPath.Replace("\\ImageWallpaper", "") + @"ImageWallpaper\";
                }
            }
            if (!Directory.Exists(fileName))
            {
                Directory.CreateDirectory(fileName);
            }
            fileName = fileName + new Uri(url).Segments[new Uri(url).Segments.Length - 1];
            Thread thread = new Thread(() => DownloaImage(fileName, url, dbn.Name));

            thread.Start();
        }
Exemple #7
0
        private void BackForm_Load(object sender, EventArgs e)
        {
            foreach (var item in BaseControl_Search.DUIControls)
            {
                if (item is DuiButton)
                {
                    DuiButton btn_search = item as DuiButton;
                    if (btn_search.Name == "btn_search")
                    {
                        btn_search.MouseClick += Btn_search_MouseClick;
                    }
                    if (btn_search.Name == "btn_searchtext")
                    {
                        foreach (var citem in btn_search.Controls)
                        {
                            if (citem is DuiTextBox)
                            {
                                DuiTextBox searchText = citem as DuiTextBox;
                                searchText.FocusedChanged += SearchText_FocusedChanged;
                            }
                        }
                    }
                }
            }
            userEntity.email  = "";
            userEntity.psw    = "";
            userEntity.imei   = "4a46fa50b289ff3c";
            userEntity.sellid = "28825252";
            bimg.MemberLogin(userEntity);
            //添加默认字段
            userEntity.menuName = "0";
            startNo             = "1";
            nCount   = "0";
            isSearch = false;
            Thread thread = new Thread(() => addBackImg());

            thread.Start();
        }
Exemple #8
0
 private void FacePanl_Load(object sender, EventArgs e)
 {
     btnList = new List <DuiButton>();
     for (int i = 0; i < emotions.Count; i++)
     {
         var btn = new DuiButton();
         btn.Tag                          = emotions[i];
         btn.Location                     = new Point(i % collect * 25 + 1, i / collect * 25 + 1);
         btn.Size                         = new Size(23, 23);
         btn.BackgroundImage              = emotions[i].face;
         btn.BackColor                    = Color.Transparent;
         btn.BackgroundImageLayout        = ImageLayout.Zoom;
         btn.BackgroundRender.BorderWidth = 0;
         btn.Image                        = emotions[i].face;
         btn.ImageSize                    = btn.Size;
         btn.BitmapCache                  = true;
         btn.MouseClick                  += Btn_MouseClick;
         btn.MouseEnter                  += Btn_MouseEnter;
         btn.MouseLeave                  += Btn_MouseLeave;
         this.Controls.Add(btn);
         btnList.Add(btn);
     }
 }
Exemple #9
0
        /// <summary>
        /// 壁纸切换类型按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_SwitchWallpaperType_MouseClick(object sender, DuiMouseEventArgs e)
        {
            DuiButton cdb = sender as DuiButton;

            if (bool.Parse(cdb.Tag.ToString()))
            {
                cdb.BaseColor       = Color.Transparent;
                cdb.BackgroundImage = Properties.Resources.btn_n;
                cdb.Tag             = false.ToString();
                pes.pes.SwitchWallpaperTypes.Remove(cdb.Name.Replace("btn_", ""));
            }
            else
            {
                //cdb.BaseColor = pes.BackColor;
                if (pes.pes.SwitchWallpaperTypes.Contains(""))
                {
                    pes.pes.SwitchWallpaperTypes.Remove("");
                }
                cdb.BackgroundImage = Properties.Resources.btn_select_n;
                cdb.Tag             = true.ToString();
                pes.pes.SwitchWallpaperTypes.Add(cdb.Name.Replace("btn_", ""));
            }
            cdb.BackgroundImageLayout = ImageLayout.Stretch;
        }
Exemple #10
0
        private void BtnPlayControl_MouseEnter(object sender, EventArgs e)
        {
            toolTip1.Show(((DuiButton)sender).Tag.ToString().ToString(), this, PointToClient(MousePosition).X, PointToClient(MousePosition).Y + 15, 2000);
            DuiButton mbu = sender as DuiButton;

            switch (mbu.Name)
            {
            case "btnStop":    //停止按钮
                mbu.BackgroundImage = Properties.Resources.stop2;
                break;

            case "btnPrev":    //上一个
                mbu.BackgroundImage = Properties.Resources.sys2;
                break;

            case "btnPlay":    //播放或暂停
                if (mbu.BackgroundImage == Properties.Resources.play1)
                {
                    mbu.BackgroundImage = Properties.Resources.play2;
                }
                else if (mbu.BackgroundImage == Properties.Resources.play2)
                {
                    mbu.BackgroundImage = Properties.Resources.play1;
                }
                else if (mbu.BackgroundImage == Properties.Resources.pause1)
                {
                    mbu.BackgroundImage = Properties.Resources.pause2;
                }
                else
                {
                    mbu.BackgroundImage = Properties.Resources.pause1;
                }
                break;

            case "btnNext":    //下一个
                mbu.BackgroundImage = Properties.Resources.xys2;
                break;

            case "btnOpenFile":    //打开文件
                mbu.BackgroundImage = Properties.Resources.dkwj2;
                break;

            case "btnVolume":    //静音
                mbu.BackgroundImage = Properties.Resources.volume2;
                break;

            case "btnScreenShot":    //截图
                mbu.BackgroundImage = Properties.Resources.jietu2;
                break;

            case "btnFullScreen":    //全屏
                mbu.BackgroundImage = Properties.Resources.allSize2;
                break;

            case "btnList":    //列表
                mbu.BackgroundImage = Properties.Resources.list2;
                break;

            default:
                break;
            }
        }
Exemple #11
0
        private void BtnPlayControl_MouseLeave(object sender, EventArgs e)
        {
            toolTip1.Hide(this);
            DuiButton mbu = sender as DuiButton;

            switch (mbu.Name)
            {
            case "btnStop":    //停止按钮
                mbu.BackgroundImage = Properties.Resources.stop1;
                break;

            case "btnPrev":    //上一个
                mbu.BackgroundImage = Properties.Resources.sys1;
                break;

            case "btnPlay":    //播放或暂停;
                if (mbu.BackgroundImage == Properties.Resources.play2)
                {
                    mbu.BackgroundImage = Properties.Resources.play1;
                }
                else if (mbu.BackgroundImage == Properties.Resources.play1)
                {
                    mbu.BackgroundImage = Properties.Resources.play2;
                }
                else if (mbu.BackgroundImage == Properties.Resources.pause1)
                {
                    mbu.BackgroundImage = Properties.Resources.pause2;
                }
                else
                {
                    mbu.BackgroundImage = Properties.Resources.pause1;
                }
                break;

            case "btnNext":    //下一个
                mbu.BackgroundImage = Properties.Resources.xys1;
                break;

            case "btnOpenFile":    //打开文件
                mbu.BackgroundImage = Properties.Resources.dkwj1;
                break;

            case "btnVolume":    //静音
                mbu.BackgroundImage = Properties.Resources.volume1;
                break;

            case "btnScreenShot":    //截图
                mbu.BackgroundImage = Properties.Resources.jietu1;
                break;

            case "btnFullScreen":    //全屏
                mbu.BackgroundImage = Properties.Resources.allSize1;
                break;

            case "btnList":    //列表
                mbu.BackgroundImage = Properties.Resources.list1;
                break;

            default:
                break;
            }
        }
Exemple #12
0
        private void setDefaultStyle()
        {
            this.BackColor = Color.FromArgb(185, pes.pes.BackColor);
            if (pes.BackGroundSkin != null)
            {
                BackGroundSkin = pes.BackGroundSkin;
                this.BackColor = Color.Transparent;
            }
            btn_point.BaseColor = Color.Red;
            btn_cg.ForeColor    = Color.FromArgb(255, pes.pes.BackColor);
            layeredPanel_cg.BringToFront();
            //常规界面相关处理
            foreach (DuiBaseControl item in layeredPanel_cg.DUIControls)
            {
                switch (item.Name)
                {
                case "ck_qd":
                    Ck_AutoStart = item as DuiCheckBox;
                    Ck_AutoStart.CheckRectColor  = Color.FromArgb(155, pes.pes.BackColor);
                    Ck_AutoStart.CheckFlagColor  = Color.FromArgb(155, pes.pes.BackColor);
                    Ck_AutoStart.CheckedChanged += Ck_AutoStart_CheckedChanged;
                    Ck_AutoStart.Checked         = pes.pes.AutoStart;
                    break;

                case "rd_min":
                case "rd_close":
                    RadioButton_CloseMode = item as DuiRadioButton;
                    RadioButton_CloseMode.CheckRectColor  = Color.FromArgb(155, pes.pes.BackColor);
                    RadioButton_CloseMode.CheckFlagColor  = Color.FromArgb(155, pes.pes.BackColor);
                    RadioButton_CloseMode.CheckedChanged += RadioButton_CloseMode_CheckedChanged;
                    if ((pes.pes.CloseMode == "isClose") && RadioButton_CloseMode.Name == "rd_close")
                    {
                        (item as DuiRadioButton).Checked = true;
                    }
                    else if ((pes.pes.CloseMode == "isMin") && RadioButton_CloseMode.Name == "rd_min")
                    {
                        (item as DuiRadioButton).Checked = true;
                    }
                    else
                    {
                        (item as DuiRadioButton).Checked = false;
                    }
                    break;

                case "":

                    break;

                default:
                    break;
                }
            }
            //壁纸切换界面相关处理
            foreach (DuiBaseControl item in layeredPanel_qhbz.DUIControls)
            {
                switch (item.Name)
                {
                case "ck_qd":
                    Ck_IsSwitchWallpaper = item as DuiCheckBox;
                    Ck_IsSwitchWallpaper.CheckRectColor  = Color.FromArgb(155, pes.pes.BackColor);
                    Ck_IsSwitchWallpaper.CheckFlagColor  = Color.FromArgb(155, pes.pes.BackColor);
                    Ck_IsSwitchWallpaper.Checked         = pes.pes.IsSwitchWallpaper;
                    Ck_IsSwitchWallpaper.CheckedChanged += Ck_IsSwitchWallpaper_CheckedChanged;
                    break;

                case "db_timedw":
                    ComboBox_InterValTimeUnit                       = item as DuiComboBox;
                    ComboBox_InterValTimeUnit.BackColor             = Color.FromArgb(155, pes.pes.BackColor);
                    ComboBox_InterValTimeUnit.SelectedIndexChanged += ComboBox_InterValTimeUnit_SelectedIndexChanged;
                    if (pes.pes.InterValTime < 60)
                    {
                        ComboBox_InterValTimeUnit.SelectedIndex = 0;
                        TextBox_InterValTime.Text = pes.pes.InterValTime.ToString();
                    }
                    else if (pes.pes.InterValTime < 3600)
                    {
                        ComboBox_InterValTimeUnit.SelectedIndex = 1;
                        TextBox_InterValTime.Text = (pes.pes.InterValTime / 60).ToString();
                    }
                    else
                    {
                        ComboBox_InterValTimeUnit.SelectedIndex = 2;
                        TextBox_InterValTime.Text = (pes.pes.InterValTime / 3600).ToString();
                    }
                    break;

                case "tb_timeStr":
                    TextBox_InterValTime              = item as DuiTextBox;
                    TextBox_InterValTime.BackColor    = Color.FromArgb(155, pes.pes.BackColor);
                    TextBox_InterValTime.AutoHeight   = true;
                    TextBox_InterValTime.Invalidated += TextBox_InterValTime_TextChanged;
                    //TextBox_InterValTime.Text = pes.pes.InterValTime.ToString();
                    break;

                default:
                    if (item is DuiButton && item.Name.Contains("btn_"))
                    {
                        DuiButton Button_SwitchWallpaperType = item as DuiButton;
                        Button_SwitchWallpaperType.Cursor          = System.Windows.Forms.Cursors.Hand;
                        Button_SwitchWallpaperType.MouseClick     += Button_SwitchWallpaperType_MouseClick;
                        Button_SwitchWallpaperType.BaseColor       = Color.Transparent;
                        Button_SwitchWallpaperType.BackgroundImage = Properties.Resources.btn_n;
                        Button_SwitchWallpaperType.IsPureColor     = false;
                        Button_SwitchWallpaperType.Tag             = false.ToString();
                        foreach (var WallpaperType in pes.pes.SwitchWallpaperTypes)
                        {
                            if (item.Name.Replace("btn_", "") == WallpaperType.ToString())
                            {
                                Button_SwitchWallpaperType.Tag             = true.ToString();
                                Button_SwitchWallpaperType.BackgroundImage = Properties.Resources.btn_select_n;
                            }
                        }
                        Button_SwitchWallpaperType.BackgroundImageLayout = ImageLayout.Stretch;
                    }
                    break;
                }
            }
            //下载设置界面相关处理
            foreach (DuiBaseControl item in layeredPanel_xzsz.DUIControls)
            {
                switch (item.Name)
                {
                case "rd_SizeForThumb":
                case "rd_SizeFor1600900":
                case "rd_SizeFor1440900":
                case "rd_SizeFor12801024":
                case "rd_SizeFor1024768":
                case "rd_SizeFor1280800":
                    RadioButton_picSize = item as DuiRadioButton;
                    RadioButton_picSize.CheckFlagColor  = Color.FromArgb(155, pes.pes.BackColor);
                    RadioButton_picSize.CheckRectColor  = Color.FromArgb(155, pes.pes.BackColor);
                    RadioButton_picSize.CheckedChanged += RadioButton_picSize_CheckedChanged;
                    if ("rd_SizeFor" + (pes.pes.PicSize == "default" ? "Thumb" : pes.pes.PicSize) == item.Name)
                    {
                        RadioButton_picSize.Checked = true;
                    }
                    else
                    {
                        RadioButton_picSize.Checked = false;
                    }
                    break;

                case "text_downloadPath":
                    lb_downloadPath           = item as DuiTextBox;
                    lb_downloadPath.BackColor = Color.FromArgb(155, pes.pes.BackColor);
                    lb_downloadPath.Text      = (String.IsNullOrEmpty(pes.pes.DownloadPath) ? AppDomain.CurrentDomain.BaseDirectory + @"ImageWallpaper\" : pes.pes.DownloadPath);
                    break;

                case "btn_selectDownloadPath":
                    btn_selectDownloadPath             = item as DuiButton;
                    btn_selectDownloadPath.Cursor      = System.Windows.Forms.Cursors.Hand;
                    btn_selectDownloadPath.MouseClick += Btn_selectDownloadPath_MouseClick;
                    break;

                case "text_cachePath":
                    lb_cachePath           = item as DuiTextBox;
                    lb_cachePath.BackColor = Color.FromArgb(155, pes.pes.BackColor);
                    lb_cachePath.Text      = (String.IsNullOrEmpty(pes.pes.CachePath) ? AppDomain.CurrentDomain.BaseDirectory + @"CacheWallpaper\" : pes.pes.CachePath);
                    if (lb_nowCacheSize != null && lb_cachePath != null)
                    {
                        lb_nowCacheSize.Text = "当前缓存:" + GetDirectoryLength(lb_cachePath.Text) / (1024 * 1024) + "MB";
                    }

                    break;

                case "btn_selectCachePath":
                    btn_selectCachePath             = item as DuiButton;
                    btn_selectCachePath.Cursor      = System.Windows.Forms.Cursors.Hand;
                    btn_selectCachePath.MouseClick += Btn_selectCachePath_MouseClick;
                    break;

                case "lb_nowCacheSize":
                    lb_nowCacheSize = item as DuiLabel;
                    if (lb_cachePath != null && lb_nowCacheSize != null)
                    {
                        lb_nowCacheSize.Text = "当前缓存:" + GetDirectoryLength(lb_cachePath.Text) / (1024 * 1024) + "MB";
                    }
                    break;

                case "lb_clearCache":
                    lb_clearCache             = item as DuiLabel;
                    lb_clearCache.Cursor      = System.Windows.Forms.Cursors.Hand;
                    lb_clearCache.MouseClick += Lb_clearCache_MouseClick;
                    break;

                default:
                    break;
                }
            }
            //关于界面相关处理
            foreach (DuiBaseControl item in layeredPanel_gy.DUIControls)
            {
                switch (item.Name)
                {
                case "lb_ver":
                    lb_ver      = item as DuiLabel;
                    lb_ver.Text = pes.pes.VerNo;
                    break;

                case "btn_update":
                    btn_update             = item as DuiButton;
                    btn_update.Cursor      = System.Windows.Forms.Cursors.Hand;
                    btn_update.BaseColor   = Color.FromArgb(155, pes.pes.BackColor);
                    btn_update.MouseClick += Btn_update_MouseClick;
                    break;

                case "btn_sendyj":
                    btn_sendyj             = item as DuiButton;
                    btn_sendyj.Cursor      = System.Windows.Forms.Cursors.Hand;
                    btn_sendyj.BaseColor   = Color.FromArgb(155, pes.pes.BackColor);
                    btn_sendyj.MouseClick += Btn_sendyj_MouseClick;
                    break;

                case "lb_mxnr1":
                    lb_mxnr1             = item as DuiLabel;
                    lb_mxnr1.Cursor      = System.Windows.Forms.Cursors.Hand;
                    lb_mxnr1.MouseClick += Lb_mxnr1_MouseClick;
                    break;

                case "lb_mxnr2":
                    lb_mxnr2             = item as DuiLabel;
                    lb_mxnr2.Cursor      = System.Windows.Forms.Cursors.Hand;
                    lb_mxnr2.MouseClick += Lb_mxnr1_MouseClick;
                    break;

                case "lb_zzemail":
                    lb_zzemail             = item as DuiLabel;
                    lb_zzemail.Cursor      = System.Windows.Forms.Cursors.Hand;
                    lb_zzemail.MouseClick += Lb_zzemail_MouseClick;
                    break;

                default:
                    break;
                }
            }
        }
Exemple #13
0
        /// <summary>
        /// 添加图片列表
        /// </summary>
        /// <param name="imgInfos"></param>
        /// <returns></returns>
        public Boolean AddImgList(List <BridImg.ImageInfo> imgInfos)
        {
            if (imgInfos.Count == 0)
            {
                return(false);
            }
            int            thisWidth   = this.Width - 5;//减去滚动条宽度
            int            zWidth      = (int)(thisWidth / 3);
            int            zHeight     = (int)(thisWidth / 3 * 0.57);
            DuiBaseControl baseControl = new DuiBaseControl();

            baseControl.Size      = new Size(thisWidth, zHeight);
            baseControl.BackColor = Color.FromArgb(245, 245, 247);
            int    i      = 0;
            string baseID = "0";

            foreach (var imgInfo in imgInfos)
            {
                baseID = imgInfo.id.ToString();
                DuiBaseControl abaseControl = new DuiBaseControl();
                abaseControl.Size     = new Size(zWidth, zHeight);
                abaseControl.Location = new Point(i * zWidth, 0);
                abaseControl.Name     = "back_" + imgInfo.id.ToString();
                //背景图
                DuiPictureBox dp = new DuiPictureBox();
                dp.Size = new Size(zWidth - 4, zHeight - 4);
                int thisWidthScreen   = Screen.PrimaryScreen.Bounds.Width;
                int thisHeiightScreen = Screen.PrimaryScreen.Bounds.Height;
                dp.Tag = imgInfo.img_1280_1024;
                getImagePathByUIrlDelegate newg = new getImagePathByUIrlDelegate(PicDeal.DownloaImage);
                dp.BackgroundImage       = Image.FromFile(newg(imgInfo.url.Replace("__85", "300_161_100")));
                dp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                dp.Name     = "back_" + imgInfo.id.ToString();
                dp.Location = new Point(2, 2);
                //dp.Cursor = System.Windows.Forms.Cursors.Hand;
                dp.MouseEnter += Dp_MouseEnter;
                dp.MouseLeave += Dp_MouseLeave;
                //dp.MouseClick += Dp_MouseClick;
                //图片说明
                DuiLabel imgTag = new DuiLabel();
                imgTag.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
                string ingTxt = (string.IsNullOrEmpty(imgInfo.utag) ? "" : imgInfo.utag);
                if (ingTxt.Length * 9 > zWidth)
                {
                    imgTag.Size     = new Size(zWidth - 4, 10 * 4);
                    imgTag.Location = new Point(2, zHeight - 43);
                }
                else
                {
                    imgTag.Size     = new Size(zWidth - 4, 10 * 2);
                    imgTag.Location = new Point(2, zHeight - 23);
                }
                imgTag.Font      = new Font("微软雅黑", 9F, FontStyle.Regular);
                imgTag.ForeColor = Color.White;
                imgTag.TextAlign = ContentAlignment.MiddleCenter;
                //imgTag.BackColor = Color.FromArgb(100, 0, 0, 0);
                imgTag.BackgroundImage       = Properties.Resources.mask_shadow;
                imgTag.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                imgTag.Text        = imgInfo.utag;
                imgTag.Name        = "imgTag_" + imgInfo.id.ToString();
                imgTag.MouseLeave += Dp_MouseLeave;

                imgTag.Cursor = System.Windows.Forms.Cursors.Hand;
                //下载按钮
                DuiButton btn_Download = new DuiButton();
                btn_Download.Size                  = new Size(35, 35);
                btn_Download.Radius                = 35;
                btn_Download.Name                  = "btn_Download_" + imgInfo.id.ToString();
                btn_Download.Text                  = "";
                btn_Download.Location              = new Point(0, 0);
                btn_Download.Cursor                = System.Windows.Forms.Cursors.Hand;
                btn_Download.AdaptImage            = false;
                btn_Download.IsPureColor           = true;
                btn_Download.BaseColor             = Color.Transparent;
                btn_Download.BackgroundImage       = Properties.Resources.dl;
                btn_Download.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
                btn_Download.ShowBorder            = false;
                btn_Download.MouseClick           += Btn_Download_MouseClick;
                btn_Download.Tag         = "保存|" + imgInfo.url_thumb;
                btn_Download.MouseEnter += Btn_Download_MouseEnter;
                btn_Download.MouseLeave += Btn_Download_MouseLeave;
                //收藏按钮
                DuiButton btn_sc = new DuiButton();
                btn_sc.Location              = new Point(35, 0);
                btn_sc.Size                  = new Size(35, 35);
                btn_sc.Text                  = "";
                btn_sc.Cursor                = System.Windows.Forms.Cursors.Hand;
                btn_sc.AdaptImage            = false;
                btn_sc.Name                  = "btn_Sc_" + imgInfo.id.ToString();
                btn_sc.BaseColor             = Color.Transparent;//Color.FromArgb(100, 0, 0, 0);
                btn_sc.Radius                = 35;
                btn_sc.ShowBorder            = false;
                btn_sc.BackgroundImage       = Properties.Resources.sc0;
                btn_sc.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
                btn_sc.MouseClick           += Btn_Sc_MouseClick;
                btn_sc.IsPureColor           = true;
                btn_sc.Tag         = "收藏|" + getSetUrl(imgInfo);
                btn_sc.MouseEnter += Btn_Download_MouseEnter;
                btn_sc.MouseLeave += Btn_Download_MouseLeave;
                //设置按钮
                DuiButton btn_Setting = new DuiButton();
                btn_Setting.Location              = new Point(70, 0);
                btn_Setting.Size                  = new Size(35, 35);
                btn_Setting.Text                  = "";
                btn_Setting.Cursor                = System.Windows.Forms.Cursors.Hand;
                btn_Setting.AdaptImage            = false;
                btn_Setting.Name                  = "btn_Setting_" + imgInfo.id.ToString();
                btn_Setting.BaseColor             = Color.Transparent;//Color.FromArgb(100, 0, 0, 0);
                btn_Setting.Radius                = 35;
                btn_Setting.Tag                   = "设置|" + getSetUrl(imgInfo);
                btn_Setting.ShowBorder            = false;
                btn_Setting.BackgroundImage       = Properties.Resources.set;
                btn_Setting.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
                btn_Setting.MouseClick           += Btn_Setting_MouseClick;
                btn_Setting.IsPureColor           = true;
                btn_Setting.MouseEnter           += Btn_Download_MouseEnter;
                btn_Setting.MouseLeave           += Btn_Download_MouseLeave;
                //按钮底层控件
                DuiBaseControl btnBaseControl = new DuiBaseControl();
                btnBaseControl.Size      = new Size(zWidth / 3, 35);
                btnBaseControl.Cursor    = System.Windows.Forms.Cursors.Hand;
                btnBaseControl.Location  = new Point(zWidth / 3 * 2 - 12, zHeight - 52);
                btnBaseControl.BackColor = Color.Transparent;
                //btnBaseControl.MouseEnter += Dp_MouseEnter;
                btnBaseControl.MouseLeave += Dp_MouseLeave;
                btnBaseControl.MouseMove  += BtnBaseControl_MouseMove;
                btnBaseControl.Controls.Add(btn_Download);
                btnBaseControl.Controls.Add(btn_sc);
                btnBaseControl.Controls.Add(btn_Setting);
                btnBaseControl.Name    = "btnBaseControl_" + imgInfo.id.ToString();
                btnBaseControl.Visible = false;

                Borders baseBorder = new Borders(baseControl);
                baseBorder.BottomWidth = 2;
                baseBorder.TopWidth    = 2;
                baseBorder.LeftWidth   = 2;
                baseBorder.RightWidth  = 2;

                abaseControl.Borders = baseBorder;
                abaseControl.Controls.Add(dp);
                abaseControl.Controls.Add(imgTag);
                abaseControl.Controls.Add(btnBaseControl);
                baseControl.Controls.Add(abaseControl);
                i++;
            }
            baseControl.Name = "imgListBaseControl_" + baseID;
            Items.Add(baseControl);
            //更新列表
            RefreshList();
            GC.Collect();
            return(true);
        }
Exemple #14
0
        /// <summary>
        /// 添加图片列表
        /// </summary>
        /// <param name="imgInfos"></param>
        /// <returns></returns>
        public Boolean AddImgList(List <Entity.MovieListEntity.DataItem> imgInfos)
        {
            if (imgInfos.Count == 0)
            {
                return(false);
            }
            int            thisWidth   = this.Width - 5;//减去滚动条宽度
            int            zWidth      = (int)(thisWidth / 3);
            int            zHeight     = (int)(thisWidth / 3 * 0.57);
            DuiBaseControl baseControl = new DuiBaseControl();

            baseControl.Size      = new Size(thisWidth, zHeight);
            baseControl.BackColor = Color.FromArgb(245, 245, 247);
            int    i      = 0;
            string baseID = "0";

            foreach (var imgInfo in imgInfos)
            {
                //EDate.DataItem newImgInfo = isValidImgInfo(imgInfo);
                baseID = imgInfo.videoID.ToString();
                DuiBaseControl abaseControl = new DuiBaseControl();
                abaseControl.Size     = new Size(zWidth, zHeight);
                abaseControl.Location = new Point(i * zWidth, 0);
                abaseControl.Name     = "back_" + imgInfo.videoID.ToString();
                //背景图
                DuiPictureBox dp = new DuiPictureBox();
                dp.Size = new Size(zWidth - 4, zHeight - 4);
                int thisWidthScreen   = Screen.PrimaryScreen.Bounds.Width;
                int thisHeiightScreen = Screen.PrimaryScreen.Bounds.Height;
                dp.Tag = imgInfo.photo;
                getImagePathByUIrlDelegate newg = new getImagePathByUIrlDelegate(PicDeal.DownloaImage);
                dp.BackgroundImage       = Image.FromFile(newg(imgInfo.photo));
                dp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                dp.Name     = "back_" + imgInfo.videoID.ToString();
                dp.Location = new Point(2, 2);
                //dp.Cursor = System.Windows.Forms.Cursors.Hand;
                dp.MouseEnter += Dp_MouseEnter;
                dp.MouseLeave += Dp_MouseLeave;
                //dp.MouseClick += Dp_MouseClick;
                //视频名称
                DuiLabel imgTag = new DuiLabel();
                imgTag.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
                string ingTxt = (string.IsNullOrEmpty(imgInfo.videoName) ? imgInfo.videoType : imgInfo.videoName);
                if (ingTxt.Length * 12 > zWidth)
                {
                    imgTag.Size     = new Size(zWidth - 4, 12 * 4);
                    imgTag.Location = new Point(2, zHeight - 48);
                }
                else
                {
                    imgTag.Size     = new Size(zWidth - 4, 12 * 2);
                    imgTag.Location = new Point(2, zHeight - 24);
                }
                imgTag.Font      = new Font("微软雅黑", 9F, FontStyle.Regular);
                imgTag.ForeColor = Color.White;
                imgTag.TextAlign = ContentAlignment.MiddleCenter;
                //imgTag.BackColor = Color.FromArgb(100, 0, 0, 0);
                imgTag.BackgroundImage       = Properties.Resources.mask_shadow;
                imgTag.BackColor             = Color.FromArgb(125, 255, 92, 138);
                imgTag.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                imgTag.Text        = ingTxt;
                imgTag.Name        = "imgTag_" + imgInfo.videoID.ToString();
                imgTag.MouseLeave += Dp_MouseLeave;
                imgTag.Cursor      = System.Windows.Forms.Cursors.Hand;
                //视频时长
                DuiLabel tvLength = new DuiLabel();
                tvLength.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
                string tvTimeStr = "上架时间:";
                if (!string.IsNullOrEmpty(imgInfo.onDate))
                {
                    tvTimeStr = "上架时间:" + imgInfo.onDate;
                }
                tvLength.Size      = new Size(tvTimeStr.Length * 12, 12 * 2);
                tvLength.Location  = new Point(zWidth - tvTimeStr.Length * 12 - 2, 2);
                tvLength.Font      = new Font("微软雅黑", 9F, FontStyle.Regular);
                tvLength.ForeColor = Color.White;
                tvLength.TextAlign = ContentAlignment.MiddleCenter;
                //imgTag.BackColor = Color.FromArgb(100, 0, 0, 0);
                tvLength.BackgroundImage       = Properties.Resources.mask_shadow;
                tvLength.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                tvLength.Text        = tvTimeStr;
                tvLength.Name        = "tvLength_" + imgInfo.videoID.ToString();
                tvLength.MouseLeave += Dp_MouseLeave;
                tvLength.Cursor      = System.Windows.Forms.Cursors.Hand;
                //播放按钮
                DuiButton btn_Download = new DuiButton();
                btn_Download.Size                  = new Size(35, 35);
                btn_Download.Radius                = 35;
                btn_Download.Name                  = "btn_Download_" + imgInfo.videoID.ToString();
                btn_Download.Text                  = "";
                btn_Download.Location              = new Point((zWidth - 20 - 35) / 2, (zHeight - 20 - 35) / 2);
                btn_Download.Cursor                = System.Windows.Forms.Cursors.Hand;
                btn_Download.AdaptImage            = false;
                btn_Download.IsPureColor           = true;
                btn_Download.BaseColor             = Color.Transparent;
                btn_Download.BackgroundImage       = Properties.Resources.play1;
                btn_Download.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
                btn_Download.ShowBorder            = false;
                btn_Download.MouseClick           += Btn_Download_MouseClick;
                btn_Download.Tag         = imgInfo;
                btn_Download.MouseEnter += Btn_Download_MouseEnter;
                btn_Download.MouseLeave += Btn_Download_MouseLeave;
                //收藏次数
                DuiButton btn_sc = new DuiButton();
                btn_sc.Location   = new Point(0, 0);
                btn_sc.Size       = new Size(30, 30);
                btn_sc.Text       = "";
                btn_sc.Cursor     = System.Windows.Forms.Cursors.Hand;
                btn_sc.AdaptImage = false;
                btn_sc.Name       = "btn_Sc_" + imgInfo.videoID.ToString();
                btn_sc.BaseColor  = Color.Transparent;//Color.FromArgb(100, 0, 0, 0);
                //btn_sc.Radius = 35;
                btn_sc.ShowBorder            = false;
                btn_sc.BackgroundImage       = Properties.Resources.sc0;
                btn_sc.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
                btn_sc.IsPureColor           = true;
                btn_sc.Tag         = imgInfo;
                btn_sc.MouseEnter += Btn_Download_MouseEnter;
                btn_sc.MouseLeave += Btn_Download_MouseLeave;
                DuiLabel dltxt = new DuiLabel();
                dltxt.Text      = imgInfo.actorName.ToString();
                dltxt.Size      = new Size(30, 16);
                dltxt.ForeColor = Color.White;
                dltxt.Location  = new Point(30, 7);
                dltxt.BackColor = Color.Transparent;
                DuiBaseControl scControl = new DuiBaseControl();
                scControl.Name     = "scControl_" + imgInfo.videoID.ToString();
                scControl.Size     = new Size(60, 30);
                scControl.Location = new Point(zWidth - 20 - 60, zHeight - 20 - 30);
                scControl.Controls.Add(btn_sc);
                scControl.Controls.Add(dltxt);
                //查看次数
                DuiButton btn_Setting = new DuiButton();
                btn_Setting.Location   = new Point(0, 0);
                btn_Setting.Size       = new Size(30, 30);
                btn_Setting.Text       = "";
                btn_Setting.Cursor     = System.Windows.Forms.Cursors.Hand;
                btn_Setting.AdaptImage = false;
                btn_Setting.Name       = "btn_Setting_" + imgInfo.videoID.ToString();
                btn_Setting.BaseColor  = Color.Transparent;//Color.FromArgb(100, 0, 0, 0);
                //btn_Setting.Radius = 35;
                btn_Setting.Tag                   = imgInfo;
                btn_Setting.ShowBorder            = false;
                btn_Setting.BackgroundImage       = Properties.Resources.eye;
                btn_Setting.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
                btn_Setting.IsPureColor           = true;
                btn_Setting.MouseEnter           += Btn_Download_MouseEnter;
                btn_Setting.MouseLeave           += Btn_Download_MouseLeave;
                DuiLabel dlatxt = new DuiLabel();
                dlatxt.Text      = imgInfo.videoTypeID.ToString();
                dlatxt.Size      = new Size(30, 16);
                dlatxt.Location  = new Point(30, 7);
                dlatxt.BackColor = Color.Transparent;
                dlatxt.ForeColor = Color.White;
                DuiBaseControl seeControl = new DuiBaseControl();
                seeControl.Name     = "seeControl_" + imgInfo.videoID.ToString();
                seeControl.Size     = new Size(60, 30);
                seeControl.Location = new Point(0, zHeight - 20 - 30);
                seeControl.Controls.Add(btn_Setting);
                seeControl.Controls.Add(dlatxt);
                //按钮底层控件
                DuiBaseControl btnBaseControl = new DuiBaseControl();
                btnBaseControl.Size        = new Size(zWidth - 20, zHeight - 20);
                btnBaseControl.Cursor      = System.Windows.Forms.Cursors.Hand;
                btnBaseControl.Location    = new Point(10, 10);
                btnBaseControl.BackColor   = Color.Transparent;
                btnBaseControl.MouseLeave += Dp_MouseLeave;
                btnBaseControl.MouseMove  += BtnBaseControl_MouseMove;
                btnBaseControl.Controls.Add(btn_Download);
                btnBaseControl.Controls.Add(scControl);
                btnBaseControl.Controls.Add(seeControl);
                btnBaseControl.Name    = "btnBaseControl_" + imgInfo.videoID.ToString();
                btnBaseControl.Visible = false;

                Borders baseBorder = new Borders(baseControl);
                baseBorder.BottomWidth = 2;
                baseBorder.TopWidth    = 2;
                baseBorder.LeftWidth   = 2;
                baseBorder.RightWidth  = 2;

                abaseControl.Borders = baseBorder;
                abaseControl.Controls.Add(dp);
                abaseControl.Controls.Add(imgTag);
                abaseControl.Controls.Add(tvLength);
                abaseControl.Controls.Add(btnBaseControl);
                baseControl.Controls.Add(abaseControl);
                i++;
            }
            baseControl.Name = "imgListBaseControl_" + baseID;
            Items.Add(baseControl);
            //更新列表
            RefreshList();
            GC.Collect();
            return(true);
        }
Exemple #15
0
        public MusicItem AddItem(string name, string listname, bool b = false)
        {
            MusicItem se       = null;
            bool      Searched = false;

            foreach (MusicListItem iy in Groups)
            {
                if (iy.Name == listname)
                {
                    Searched = true;
                }
            }
            if (Searched)
            {
                if (IsInList(name, listname))
                {
                    return(null);
                }
                else
                {
                    int a = 0;
                    for (int i = 0; i < Items.Count; i++)
                    {
                        if (Items[i].Tag != null)
                        {
                            if (Items[i].Tag.ToString() == listname)
                            {
                                a = a + 1;
                            }
                        }
                    }
                    DuiBaseControl ix = null;
                    foreach (DuiBaseControl ixx in Items)
                    {
                        if (ixx.Name.Replace("list_", "") == listname)
                        {
                            ix = ixx;
                        }
                    }
                    if (File.Exists(name))
                    {
                        #region 本地音乐
                        Mp3Info info = MP3Info.GetMp3Info(name);

                        string   artists       = info.Artist;
                        string   album         = info.Album;
                        string   length        = info.MusicLength;
                        string   title         = info.Title;
                        DuiLabel infoforsinger = new DuiLabel();
                        infoforsinger.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAlias;
                        infoforsinger.Size           = new Size(140, 20);
                        if (artists != "")
                        {
                            infoforsinger.Text = "-" + artists;
                        }
                        infoforsinger.Location  = new Point(160, 4);
                        infoforsinger.ForeColor = Color.FromArgb(220, 220, 220);
                        infoforsinger.Font      = new Font("微软雅黑", 9F);
                        infoforsinger.Name      = "infoforsinger";

                        DuiPictureBox albumpic = new DuiPictureBox();
                        albumpic.Size                  = new Size(50, 50);
                        albumpic.Location              = new Point(5, 0);
                        albumpic.Name                  = "albumpic";
                        albumpic.BackgroundImage       = Properties.Resources.default_album;
                        albumpic.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
                        albumpic.Visible               = false;

                        DuiLabel infoforTimer = new DuiLabel();
                        infoforTimer.Size           = new Size(70, 20);
                        infoforTimer.Text           = length;
                        infoforTimer.Location       = new Point(350, 4);
                        infoforTimer.ForeColor      = Color.FromArgb(255, 255, 255);
                        infoforTimer.Font           = new Font("微软雅黑", 9F);
                        infoforTimer.Name           = "infoforTimer";
                        infoforTimer.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAlias;

                        DuiButton btnplay = new DuiButton();
                        btnplay.Size         = new Size(20, 20);
                        btnplay.Location     = new Point(295, 3);
                        btnplay.NormalImage  = Properties.Resources.list_btn_play_normal;
                        btnplay.HoverImage   = Properties.Resources.list_btn_play_hover;
                        btnplay.PressedImage = Properties.Resources.list_btn_play_press;
                        btnplay.MouseClick  += Btnplay_MouseDown;
                        btnplay.MouseEnter  += Btnplay_MouseEnter;
                        btnplay.MouseLeave  += Btnplay_MouseLeave;
                        btnplay.Name         = "btnplay";
                        btnplay.Tag          = name;
                        btnplay.Visible      = false;

                        DuiButton btnpause = new DuiButton();
                        btnpause.Size         = new Size(20, 20);
                        btnpause.Location     = new Point(295, 3);
                        btnpause.NormalImage  = Properties.Resources.list_btn_pause_normal;
                        btnpause.HoverImage   = Properties.Resources.list_btn_pause_hover;
                        btnpause.PressedImage = Properties.Resources.list_btn_pause_press;
                        btnpause.MouseClick  += Btnpause_MouseClick;
                        btnpause.Name         = "btnpause";
                        btnpause.Tag          = name;
                        btnpause.MouseEnter  += Btnpause_MouseEnter;
                        btnpause.MouseLeave  += Btnpause_MouseLeave;
                        btnpause.Visible      = false;

                        DuiButton btndel = new DuiButton();
                        btndel.Size         = new Size(20, 20);
                        btndel.Location     = new Point(317, 3);
                        btndel.NormalImage  = Properties.Resources.btn_del_h;
                        btndel.HoverImage   = Properties.Resources.btn_del_n;
                        btndel.PressedImage = Properties.Resources.btn_del_p;
                        btndel.MouseClick  += Btndel_MouseClick;
                        btndel.MouseEnter  += Btndel_MouseEnter;
                        btndel.MouseLeave  += Btndel_MouseLeave;
                        btndel.Name         = "btndel";
                        btndel.Tag          = listname;
                        btndel.Visible      = false;

                        DuiLabel lbl = new DuiLabel();
                        lbl.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAlias;
                        lbl.Size           = new System.Drawing.Size(160, 17);
                        if (Path.GetFileNameWithoutExtension(name).Length > 14)
                        {
                            lbl.Text        = Path.GetFileNameWithoutExtension(name).Remove(13).Insert(13, "...");
                            lbl.Tag         = Path.GetFileNameWithoutExtension(name);
                            lbl.MouseEnter += Lbl_MouseEnter;
                            lbl.MouseLeave += Lbl_MouseLeave;
                        }
                        else
                        {
                            lbl.Text = Path.GetFileNameWithoutExtension(name);
                            lbl.Tag  = Path.GetFileNameWithoutExtension(name);
                        }
                        lbl.Location  = new Point(10, 4);
                        lbl.ForeColor = Color.FromArgb(255, 255, 255);
                        lbl.Font      = new Font("微软雅黑", 9F);
                        lbl.Name      = "lbl";


                        DuiBaseControl listx = new DuiBaseControl();
                        listx.BackColor = Color.FromArgb(0, Color.Black);
                        listx.Width     = Width;
                        listx.Height    = 25;
                        listx.Controls.Add(lbl);
                        listx.Controls.Add(infoforsinger);
                        listx.Controls.Add(infoforTimer);
                        listx.Controls.Add(btndel);
                        listx.Controls.Add(btnplay);
                        listx.Controls.Add(btnpause);
                        listx.Controls.Add(albumpic);
                        listx.MouseDown        += Listx_MouseDown;
                        listx.MouseUp          += Listx_MouseUp;
                        listx.MouseMove        += Listx_MouseMove;
                        listx.MouseEnter       += Listx_MouseEnter;
                        listx.MouseLeave       += Listx_MouseLeave;
                        listx.MouseDoubleClick += Listx_MouseDoubleClick;
                        listx.MouseClick       += Listx_MouseClick;
                        listx.Name              = name;
                        listx.Height            = 25;
                        listx.Tag = listname;

                        if (!b)
                        {
                            Items.Add(listx);
                        }
                        else
                        {
                            Items.Insert(Items.IndexOf(ix) + a + 1, listx);
                        }

                        foreach (MusicListItem iy in Groups)
                        {
                            if (iy.Name == listname)
                            {
                                MusicItem m = new MusicItem();
                                m.Path       = name;
                                m.IsOnline   = false;
                                m.ParentName = listname;
                                if (title != "")
                                {
                                    m.Name = title;
                                }
                                else
                                {
                                    m.Name = lbl.Tag.ToString();
                                }
                                m.Singer = artists;
                                iy.musics.Add(m);
                            }
                        }

                        if (OpenedList == listname)
                        {
                            listx.Visible = true;
                        }
                        else
                        {
                            listx.Visible = false;
                        }
                        #endregion
                    }
                    else
                    {
                        #region 失效音乐

                        DuiLabel infoforTimer = new DuiLabel();
                        infoforTimer.Size           = new Size(70, 20);
                        infoforTimer.Text           = "文件失效";
                        infoforTimer.Location       = new Point(350, 4);
                        infoforTimer.ForeColor      = Color.Red;
                        infoforTimer.Font           = new Font("微软雅黑", 9F);
                        infoforTimer.Name           = "infoforTimer";
                        infoforTimer.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAlias;

                        DuiButton btndel = new DuiButton();
                        btndel.Size         = new Size(20, 20);
                        btndel.Location     = new Point(317, 3);
                        btndel.NormalImage  = Properties.Resources.btn_del_h;
                        btndel.HoverImage   = Properties.Resources.btn_del_n;
                        btndel.PressedImage = Properties.Resources.btn_del_p;
                        btndel.MouseClick  += Btndel_MouseClick;
                        btndel.MouseEnter  += Btndel_MouseEnter;
                        btndel.MouseLeave  += Btndel_MouseLeave;
                        btndel.Name         = "btndel";
                        btndel.Tag          = listname;
                        btndel.Visible      = false;

                        DuiLabel lbl = new DuiLabel();
                        lbl.TextRenderMode = System.Drawing.Text.TextRenderingHint.AntiAlias;
                        lbl.Size           = new System.Drawing.Size(160, 20);
                        if (Path.GetFileNameWithoutExtension(name).Length > 14)
                        {
                            lbl.Text        = Path.GetFileNameWithoutExtension(name).Remove(13).Insert(13, "...");
                            lbl.MouseEnter += Lbl_MouseEnter;
                        }
                        else
                        {
                            lbl.Text = Path.GetFileNameWithoutExtension(name);
                        }
                        lbl.Location    = new Point(10, 4);
                        lbl.ForeColor   = Color.Red;
                        lbl.Font        = new Font("微软雅黑", 9F);
                        lbl.Name        = "lbl";
                        lbl.Tag         = Path.GetFileNameWithoutExtension(name);
                        lbl.MouseLeave += Lbl_MouseLeave;

                        DuiBaseControl listx = new DuiBaseControl();
                        listx.BackColor = Color.FromArgb(0, Color.Black);
                        listx.Width     = Width;
                        listx.Height    = 25;
                        listx.Controls.Add(lbl);
                        listx.Controls.Add(infoforTimer);
                        listx.Controls.Add(btndel);
                        listx.MouseMove  += Listx_MouseMove;
                        listx.MouseDown  += Listx_MouseDown;
                        listx.MouseUp    += Listx_MouseUp;
                        listx.MouseEnter += Listx_MouseEnterLose;
                        listx.MouseLeave += Listx_MouseLeaveLose;
                        listx.Name        = name;
                        listx.Height      = 25;
                        listx.Tag         = listname;

                        if (!b)
                        {
                            Items.Add(listx);
                        }
                        else
                        {
                            Items.Insert(Items.IndexOf(ix) + a + 1, listx);
                        }

                        foreach (MusicListItem iy in Groups)
                        {
                            if (iy.Name == listname)
                            {
                                MusicItem m = new MusicItem();
                                m.Path     = name;
                                m.IsOnline = false;

                                iy.musics.Add(m);
                            }
                        }

                        if (OpenedList == listname)
                        {
                            listx.Visible = true;
                        }
                        else
                        {
                            listx.Visible = false;
                        }

                        #endregion
                    }
                    a = a + 1;
                    if (a == 0)
                    {
                        ((DuiLabel)ix.FindControl("Count")[0]).Text = "[这个列表没有歌曲,可以直接把歌曲拖到这里来哦]";
                    }
                    else
                    {
                        ((DuiLabel)ix.FindControl("Count")[0]).Text = "[" + a.ToString() + "]";
                    }
                    RefreshList();
                }
            }
            GC.Collect();
            return(se);
        }
Exemple #16
0
        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);
        }