/// <summary> /// 逐个显示 /// </summary> /// <param name="tag"></param> /// <param name="img"></param> public static void DisPlayListItem(LiuXingData tag, System.Drawing.Image img) { if (tag == null) return; // 磁贴方块 var cellpal = new EPanel { Size = new System.Drawing.Size(406, 210), BackColor = System.Drawing.Color.White, Tag = tag }; PublicStatic.LiuXingCon.Controls.Add(cellpal); if (!string.IsNullOrEmpty(tag.Cos)) { new HDarge( cellpal, tag.Cos, new System.Drawing.Font(PublicStatic.MainFont, 12F), new System.Drawing.Size(40, 25), new System.Drawing.Point(-2, 44 + 24 + 45 + 25 + 20 - 135), System.Drawing.Color.FromArgb(248, 248, 248), System.Drawing.Color.FromArgb(0, 122, 204), System.Drawing.ContentAlignment.MiddleCenter, System.Windows.Forms.AnchorStyles.Top ); } // 方块内海报 if (img != null) { var cellimg = new EPicBox { Size = new System.Drawing.Size(150, 210), BackColor = System.Drawing.Color.White, Image = img, SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage }; cellpal.Controls.Add(cellimg); } // 方块内文字 var tempname = tag.Name; if (!string.IsNullOrEmpty(tempname)) { if (tempname.Contains("/")) { tempname = tempname.Split("/".ToCharArray())[0]; } new HDarge( cellpal, tempname, new System.Drawing.Font(PublicStatic.MainFont, 22F), new System.Drawing.Size(244, 42), new System.Drawing.Point(150, 10), System.Drawing.Color.FromArgb(0, 122, 204), System.Drawing.Color.Transparent, System.Drawing.ContentAlignment.BottomCenter, System.Windows.Forms.AnchorStyles.Top ); } new HDarge( cellpal, "", new System.Drawing.Font(PublicStatic.MainFont, 14F), new System.Drawing.Size(240, 1), new System.Drawing.Point(150 + 8, 48 + 10), System.Drawing.Color.Transparent, System.Drawing.Color.FromArgb(90, 122, 204), System.Drawing.ContentAlignment.MiddleLeft, System.Windows.Forms.AnchorStyles.Top ); new HDarge( cellpal, "主演:" + tag.Car, new System.Drawing.Font(PublicStatic.MainFont, 12F), new System.Drawing.Size(248, 45), new System.Drawing.Point(150 + 6, 44 + 24), System.Drawing.Color.FromArgb(60, 60, 60), System.Drawing.Color.Transparent, System.Drawing.ContentAlignment.MiddleLeft, System.Windows.Forms.AnchorStyles.Top ); new HDarge( cellpal, "年代:" + tag.Tim, new System.Drawing.Font(PublicStatic.MainFont, 12F), new System.Drawing.Size(120, 25), new System.Drawing.Point(150 + 6, 44 + 24 + 45), System.Drawing.Color.FromArgb(60, 60, 60), System.Drawing.Color.Transparent, System.Drawing.ContentAlignment.MiddleLeft, System.Windows.Forms.AnchorStyles.Top ); new HDarge( cellpal, "地区:" + tag.Loc, new System.Drawing.Font(PublicStatic.MainFont, 12F), new System.Drawing.Size(120, 25), new System.Drawing.Point(150 + 6 + 120, 44 + 24 + 45), System.Drawing.Color.FromArgb(60, 60, 60), System.Drawing.Color.Transparent, System.Drawing.ContentAlignment.MiddleLeft, System.Windows.Forms.AnchorStyles.Top ); new HDarge( cellpal, "类型:" + tag.Typ, new System.Drawing.Font(PublicStatic.MainFont, 12F), new System.Drawing.Size(120, 25), new System.Drawing.Point(150 + 6, 44 + 24 + 45 + 25), System.Drawing.Color.FromArgb(60, 60, 60), System.Drawing.Color.Transparent, System.Drawing.ContentAlignment.MiddleLeft, System.Windows.Forms.AnchorStyles.Top ); new HDarge( cellpal, "更新:" + tag.Upt, new System.Drawing.Font(PublicStatic.MainFont, 12F), new System.Drawing.Size(120, 25), new System.Drawing.Point(150 + 6 + 120, 44 + 24 + 45 + 25), System.Drawing.Color.FromArgb(60, 60, 60), System.Drawing.Color.Transparent, System.Drawing.ContentAlignment.MiddleLeft, System.Windows.Forms.AnchorStyles.Top ); // 方块内按钮 var temphds = tag.HDs; if (string.IsNullOrEmpty(temphds)) return; var playbtn = new LButton ( cellpal, 1, temphds, new System.Drawing.Font(PublicStatic.MainFont, 12.5F), new System.Drawing.Size(101, 32), new System.Drawing.Point(150 + 152, 40 + 25*5 + 2*5), System.Drawing.Color.FromArgb(0, 122, 204), System.Drawing.Color.FromArgb(248, 248, 248), System.Drawing.Color.FromArgb(248, 248, 248), System.Drawing.Color.FromArgb(0, 122, 204), System.Drawing.Color.FromArgb(0, 122, 204), System.Drawing.Color.FromArgb(248, 248, 248), System.Windows.Forms.AnchorStyles.Top ); var copybtn = new LButton ( cellpal, 1, "复制链接", new System.Drawing.Font(PublicStatic.MainFont, 12.5F), new System.Drawing.Size(101, 32), new System.Drawing.Point(150 + 152 - 101 - 8, 40 + 25*5 + 2*5), System.Drawing.Color.FromArgb(0, 122, 204), System.Drawing.Color.FromArgb(248, 248, 248), System.Drawing.Color.FromArgb(248, 248, 248), System.Drawing.Color.FromArgb(0, 122, 204), System.Drawing.Color.FromArgb(0, 122, 204), System.Drawing.Color.FromArgb(248, 248, 248), System.Windows.Forms.AnchorStyles.Top ); copybtn.MouseClick += Copybtn_MouseClick; playbtn.MouseClick += Playbtn_MouseClick; if (string.IsNullOrEmpty(PublicStatic.SearchBox.Text)) { PublicStatic.LiuXingCon.Focus(); } }
public static void AddPalItem() { if (PublicStatic.LiuXingNav == null) return; PublicStatic.LiuXingNav.Controls.Clear(); #region 添加面板 // 总面板 AddPal = new LPanel ( PublicStatic.LiuXingNav, 0, new Size(PublicStatic.LiuXingNav.Width, PublicStatic.LiuXingNav.Height), new Point(0, 0), Color.Transparent, Color.Transparent, //System.Drawing.Color.FromArgb(255, 255, 255) AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top ); // 应用名字 AppName = new InputBoxWithDesc( AddPal, 1, 2, @"链接命名", AppNameTip, null, new Font(PublicStatic.MainFont, 12.5F), new Size(104, 34), new Font(PublicStatic.MainFont, 12F), new Size(444, 34), new Point(8, 8 + (34 + 8)*0), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], Color.FromArgb(220, 220, 220), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), Color.FromArgb(75, 75, 75), Color.FromArgb(25, 25, 25), AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 1}; // 应用链接 AppUrl = new InputBoxWithDesc( AddPal, 1, 2, @"链接地址", AppUrlTip, null, new Font(PublicStatic.MainFont, 12.5F), new Size(104, 34), new Font(PublicStatic.MainFont, 12F), new Size(444, 34), new Point(8, 8 + (34 + 8)*1), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], Color.FromArgb(220, 220, 220), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), Color.FromArgb(75, 75, 75), Color.FromArgb(25, 25, 25), AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 2}; // 应用宽度 AppWidth = new InputBoxWithDesc( AddPal, 1, 2, @"链接宽度", AppWidthTip, null, new Font(PublicStatic.MainFont, 12.5F), new Size(104, 34), new Font(PublicStatic.MainFont, 12F), new Size(165, 34), new Point(8 + 84 + 464 + 8, 8 + (34 + 8)*0), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], Color.FromArgb(220, 220, 220), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), Color.FromArgb(75, 75, 75), Color.FromArgb(25, 25, 25), AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 3}; // 应用高度 AppHeight = new InputBoxWithDesc( AddPal, 1, 2, @"链接高度", AppHeightTip, null, new Font(PublicStatic.MainFont, 12.5F), new Size(104, 34), new Font(PublicStatic.MainFont, 12F), new Size(165, 34), new Point(8 + 84 + 464 + 8, 8 + (34 + 8)*1), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], Color.FromArgb(220, 220, 220), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), Color.FromArgb(75, 75, 75), Color.FromArgb(25, 25, 25), AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 4}; // 重填按钮 AppCancel = new LButton ( AddPal, 1, "重 填", new Font(PublicStatic.MainFont, 12.5F), new Size(BtnWidth, 32), new Point(8 + (BtnWidth + 8)*0, 8 + (34 + 8)*2), PublicStatic.SouSouColor[1], PublicStatic.SouSouColor[1], PublicStatic.SouSouColor[1], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 5}; AppCancel.MouseClick += AppCancel_MouseClick; // 预览按钮 AppPreview = new LButton ( AddPal, 1, "预 览", new Font(PublicStatic.MainFont, 12.5F), new Size(BtnWidth, 32), new Point(8 + (BtnWidth + 8)*1, 8 + (34 + 8)*2), PublicStatic.SouSouColor[2], PublicStatic.SouSouColor[2], PublicStatic.SouSouColor[2], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 7}; AppPreview.MouseClick += AppPreview_MouseClick; // 添加 AppAddItem = new LButton ( AddPal, 1, "添 加", new Font(PublicStatic.MainFont, 12.5F), new Size(BtnWidth, 32), new Point(8 + (BtnWidth + 8)*2, 8 + (34 + 8)*2), PublicStatic.SouSouColor[0], PublicStatic.SouSouColor[0], PublicStatic.SouSouColor[0], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 6}; AppAddItem.MouseClick += AppAddItem_MouseClick; // 删除按钮 AppDelete = new LButton ( AddPal, 1, "删 除", new Font(PublicStatic.MainFont, 12.5F), new Size(BtnWidth, 32), new Point(8 + (BtnWidth + 8)*3, 8 + (34 + 8)*2), PublicStatic.SouSouColor[3], PublicStatic.SouSouColor[3], PublicStatic.SouSouColor[3], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 7}; AppDelete.MouseClick += AppDelete_MouseClick; // 返回按钮 AppSaveBack = new LButton ( AddPal, 1, "返 回", new Font(PublicStatic.MainFont, 12.5F), new Size(BtnWidth, 32), new Point(8 + (BtnWidth + 8)*4, 8 + (34 + 8)*2), PublicStatic.SouSouColor[4], PublicStatic.SouSouColor[4], PublicStatic.SouSouColor[4], Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[PublicStatic.SouSouIndex], AnchorStyles.Left | AnchorStyles.Top ) {TabIndex = 7}; AppSaveBack.MouseClick += AppSaveBack_MouseClick; #endregion UserItemLists = ReadByLocalPath(); }
/// <summary> /// 逐个加载应用 /// </summary> private static void LoadNavItems() { // 加载应用 var index = 0; var count = 0; foreach (var dic in PublicStatic.Dics) { for (int j = 0; j < dic.Value.Count; j++) { // 限定显示这么多应用 if (count <= XianDing) { WatchTvData vk = dic.Value[j]; // 加载 var btn = new LButton ( PublicStatic.LiuXingNav, 1, vk.Name, new System.Drawing.Font(PublicStatic.MainFont, 12.5F), new System.Drawing.Size(115, 32), new System.Drawing.Point(8 + (101 + 8) * 0, 6), PublicStatic.SouSouColor[index], PublicStatic.SouSouColor[index], System.Drawing.Color.FromArgb(248, 248, 248), PublicStatic.SouSouColor[index], PublicStatic.SouSouColor[index], System.Drawing.Color.FromArgb(248, 248, 248), BaseAnchor.AnchorTopLeft ) {Tag = vk}; btn.MouseClick += btn_MouseClick; // 发现第一个应用的时候加载下 if (count == 0) { if (ChangeUi) { ChangeUi = false; } else { PublicStatic.NowPlayWatch = vk; PublicStatic.LiuXingCon.Navigate(vk.Url); } } // 继续下一个 count++; } } // 控制颜色序号 index++; } }