예제 #1
0
 private void Player_DownProgChange(DownItem Item, double val, double maxval)
 {
     if (menuXList1.SelectItemIndex > -1)
     {
         Control[] Controls = panel_videos.Controls.Find(Item.ID, false);
         if (Controls != null && Controls.Length > 0)
         {
             TSkin.TBut but = Controls[0] as TSkin.TBut;
             but.MaxValue = maxval;
             but.Value    = val;
         }
     }
 }
예제 #2
0
 private void Player_DownComplete(DownItem Item)
 {
     if (menuXList1.SelectItemIndex > -1)
     {
         Control[] Controls = panel_videos.Controls.Find(Item.ID, false);
         if (Controls != null && Controls.Length > 0)
         {
             TSkin.TBut but = Controls[0] as TSkin.TBut;
             but.MaxValue = but.Value = 0;
             but.Image    = Properties.Resources.icon_success;
         }
     }
 }
예제 #3
0
        private void menuXList1_DownClick(TPlayerList.TopItem Item)
        {
            panel7.Visible             = isdownModel = false;
            btn_play.Text              = "播放全部";
            btn_down.Text              = "下载";
            playIndex                  = Item.Index;
            menuXList1.SelectItemIndex = Item.Index;
            menuXList1.Tom(Item);
            panel_videos.Visible = false;
            panel_videos.Controls.Clear();
            playAddress = video.playInformation.Find(ab => ab.playType == Item.Name);


            List <string> _WebVideoPlayType = SystemSettings.WebVideoPlayType;

            if (_WebVideoPlayType.Contains(Item.Name))
            {
                _WebVideoPlayType.Remove(Item.Name);
            }
            _WebVideoPlayType.Insert(0, Item.Name);
            SystemSettings.SetWebVideoPlayType = string.Join(";", _WebVideoPlayType);

            string _colltag = "webvideo[" + this.videotype + "]_" + playIndex + "_" + video.id;
            int    coll     = 0;

            if (SystemSettings.RememberLocation && File.Exists(Program.CachePath + "coll\\" + _colltag))
            {
                int.TryParse(File.ReadAllText(Program.CachePath + "coll\\" + _colltag), out coll);
            }
            if (coll > 0)
            {
                if (playAddress.videoUrl.Count - 1 < coll)
                {
                    coll = 0;
                    try
                    {
                        File.Delete(Program.CachePath + "coll\\" + _colltag);
                    }
                    catch { }
                }
                btn_play.Text = "继续 " + playAddress.videoUrl[coll].playName;
            }
            TSkin.TBut slabel = null;
            for (int i = 0; i < playAddress.videoUrl.Count; i++)
            {
                int      _index = i;
                VideoUrl item   = playAddress.videoUrl[i];

                TSkin.TBut but = new TSkin.TBut
                {
                    TabIndex          = _index,
                    Name              = video.id + "_" + menuXList1.SelectItemIndex + item.playName,
                    ASize             = true,
                    Radius            = 6,
                    Text              = item.playName,
                    ImageSize         = new Size(20, 20),
                    ImageMargin       = new Padding(6, 0, 0, 0),
                    TextAlign         = ContentAlignment.MiddleRight,
                    TextMargin        = new Padding(6, 4, 6, 4),
                    ValueColor        = Color.FromArgb(140, Color.OrangeRed),
                    BorderColorActive = Color.OrangeRed,
                    BorderColor       = Color.OrangeRed,

                    BackColor        = Color.FromArgb(20, 0, 0, 0),
                    BackColor2       = Color.FromArgb(20, 0, 0, 0),
                    BackColorActive  = Color.DodgerBlue,
                    BackColorActive2 = Color.DodgerBlue,
                    ForeColorActive  = Color.White,
                    Tag = item
                };

                if (coll > 0 && _index == coll)
                {
                    slabel       = but;
                    but.IsActive = true;
                    //file.Icon = Properties.Resources.icon_success;
                }
                if (File.Exists(Program.DownLoadPath + video.videoName + "\\" + item.playName + Path.GetExtension(item.playURL)))
                {
                    but.Image = Properties.Resources.icon_success;
                }
                panel_videos.Controls.Add(but);
                but.Click += (a, b) =>
                {
                    if (isdownModel)
                    {
                        if (!File.Exists(Program.DownLoadPath + video.videoName + "\\" + item.playName + Path.GetExtension(item.playURL)))
                        {
                            if (but.BorderWidth == 0)
                            {
                                but.BorderWidth = 1;
                            }
                            else
                            {
                                but.BorderWidth = 0;
                            }
                        }
                    }
                    else
                    {
                        string pathcoll = Program.CachePath + "coll\\" + _colltag;
                        (Program.CachePath + "coll\\").CreateDirectory(true);
                        File.WriteAllText(pathcoll, _index.ToString());

                        _play(_index, _colltag);
                    }
                };
            }
            panel_videos.Visible = true;
            if (slabel != null)
            {
                slabel.Focus();
            }
        }