public HubMenuDataSource() { string itemContent = string.Empty; var group1 = new HubMenuGroup("NewGroup", "最新漫画", string.Empty, string.Empty, string.Empty); group1.Items.Add(new MangaMenuItem("New-1", "海贼王", "http://localhost:8800/image/Hub/", group1, "http://comic.131.com/content/shaonian/2104.html", HubItemSizes.FocusItem, string.Empty)); group1.Items.Add(new MangaMenuItem("New-2", "火影", "http://localhost:8800/image/Hub/hub-BizPromotion.png", group1, "http://comic.131.com/content/shaonian/2104.html", HubItemSizes.SecondarySmallItem, "#FF00B1EC")); group1.Items.Add(new MangaMenuItem("New-3", "死神", "http://localhost:8800/image/Hub/hub-announcement.png", group1, "http://comic.131.com/content/shaonian/2104.html", HubItemSizes.SecondarySmallItem, "#FFA80032")); group1.Items.Add(new MangaMenuItem("New-4", "猎人", "http://localhost:8800/image/Hub/hub-News.png", group1, "http://comic.131.com/content/shaonian/2104.html", HubItemSizes.SecondarySmallItem, "#FF45008A")); var group2 = new HubMenuGroup("TopGroup", "热门连载", string.Empty, string.Empty, string.Empty); group2.Items.Add(new MangaMenuItem("Top-1", "海贼王","http://localhost:8800/image/Hub/hub-perb.png", group2, "http://abchina.azurewebsites.net/onlinebanking.htm", HubItemSizes.FocusItem, string.Empty)); group2.Items.Add(new MangaMenuItem("Top-2", "死神", "http://localhost:8800/image/Hub/hub-promotion.png", group2, "http://www.abchina.com/cn/CreditCard/default.htm", HubItemSizes.SecondarySmallItem, "#FFB3020A")); group2.Items.Add(new MangaMenuItem("Top-3", "猎人", "http://localhost:8800/image/Hub/hub-Interest1.png", group2, "http://www.abchina.com/cn/CreditCard/default.htm", HubItemSizes.SecondarySmallItem, "#FFD06112")); var group3 = new HubMenuGroup("OverGroup", "热门完结",string.Empty, string.Empty, string.Empty); group3.Items.Add(new MangaMenuItem("Over-1", "海贼王", "http://localhost:8800/image/Hub/hub-generalloan.png",group3, "http://www.abchina.com/cn/Common/Calculator/loan.htm", HubItemSizes.SecondarySmallItem, string.Empty)); group3.Items.Add(new MangaMenuItem("Over-2", "火影", "http://localhost:8800/image/Hub/hub-loancalc.png", group3, "http://www.abchina.com/cn/Common/Calculator/LoanComp.htm", HubItemSizes.SecondarySmallItem, string.Empty)); group3.Items.Add(new MangaMenuItem("Over-3", "死神", "http://localhost:8800/image/Hub/hub-housecalc.png",group3, "http://www.abchina.com/cn/Common/Calculator/CalcLoanOrRental.htm", HubItemSizes.SecondarySmallItem, string.Empty)); group3.Items.Add(new MangaMenuItem("Over-4", "猎人", "http://localhost:8800/image/Hub/hub-morecalc.png", group3, "http://www.abchina.com/cn/PublicPlate/Calculator/", HubItemSizes.OtherSmallItem, "#FFA42900")); this.MenuGroups.Add(group1); this.MenuGroups.Add(group2); this.MenuGroups.Add(group3); }
public MangaMenuItem(string uniqueId, string title, string imagePath, HubMenuGroup group, string url, Size size, string titleBackground) : base(uniqueId, title, String.Empty, imagePath, string.Empty,string.Empty,group,url,size,titleBackground) { _height = size.Height; _width = size.Width; _imagePath = imagePath; _url = url; }
public HubMenuItem(string uniqueId, string title, string subtitle, string imagePath, string description, string content, HubMenuGroup group, string link, Size size, string titleBackground) : base(uniqueId, title, subtitle, imagePath, description) { this._content = content; this._group = group; this._itemSize = size; this._link = link; this._titleBackground = titleBackground; }
public Task<ObservableCollection<HubMenuGroup>> GetMainMenu() { return Task.Run<ObservableCollection<HubMenuGroup>>(() => { ObservableCollection<HubMenuGroup> MenuGroups = new ObservableCollection<HubMenuGroup>(); if (WebType == WebSiteEnum.Local) { var group1 = new HubMenuGroup("NewGroup", "最新漫画", string.Empty, string.Empty, string.Empty); group1.Items.Add(new MangaMenuItem("New-1", "海贼王", "http://localhost:8800/image/Hub/", group1, "http://comic.131.com/content/shaonian/2104.html", HubItemSizes.FocusItem, string.Empty)); group1.Items.Add(new MangaMenuItem("New-2", "火影", "http://localhost:8800/image/Hub/hub-BizPromotion.png", group1, "http://comic.131.com/content/shaonian/2104.html", HubItemSizes.SecondarySmallItem, "#FF00B1EC")); group1.Items.Add(new MangaMenuItem("New-3", "死神", "http://localhost:8800/image/Hub/hub-announcement.png", group1, "http://comic.131.com/content/shaonian/2104.html", HubItemSizes.SecondarySmallItem, "#FFA80032")); group1.Items.Add(new MangaMenuItem("New-4", "猎人", "http://localhost:8800/image/Hub/hub-News.png", group1, "http://comic.131.com/content/shaonian/2104.html", HubItemSizes.SecondarySmallItem, "#FF45008A")); var group2 = new HubMenuGroup("TopGroup", "热门连载", string.Empty, string.Empty, string.Empty); group2.Items.Add(new MangaMenuItem("Top-1", "海贼王", "http://localhost:8800/image/Hub/hub-perb.png", group2, "http://abchina.azurewebsites.net/onlinebanking.htm", HubItemSizes.FocusItem, string.Empty)); group2.Items.Add(new MangaMenuItem("Top-2", "死神", "http://localhost:8800/image/Hub/hub-promotion.png", group2, "http://www.abchina.com/cn/CreditCard/default.htm", HubItemSizes.SecondarySmallItem, "#FFB3020A")); group2.Items.Add(new MangaMenuItem("Top-3", "猎人", "http://localhost:8800/image/Hub/hub-Interest1.png", group2, "http://www.abchina.com/cn/CreditCard/default.htm", HubItemSizes.SecondarySmallItem, "#FFD06112")); var group3 = new HubMenuGroup("OverGroup", "热门完结", string.Empty, string.Empty, string.Empty); group3.Items.Add(new MangaMenuItem("Over-1", "海贼王", "http://localhost:8800/image/Hub/hub-generalloan.png", group3, "http://www.abchina.com/cn/Common/Calculator/loan.htm", HubItemSizes.SecondarySmallItem, string.Empty)); group3.Items.Add(new MangaMenuItem("Over-2", "火影", "http://localhost:8800/image/Hub/hub-loancalc.png", group3, "http://www.abchina.com/cn/Common/Calculator/LoanComp.htm", HubItemSizes.SecondarySmallItem, string.Empty)); group3.Items.Add(new MangaMenuItem("Over-3", "死神", "http://localhost:8800/image/Hub/hub-housecalc.png", group3, "http://www.abchina.com/cn/Common/Calculator/CalcLoanOrRental.htm", HubItemSizes.SecondarySmallItem, string.Empty)); group3.Items.Add(new MangaMenuItem("Over-4", "猎人", "http://localhost:8800/image/Hub/hub-morecalc.png", group3, "http://www.abchina.com/cn/PublicPlate/Calculator/", HubItemSizes.OtherSmallItem, "#FFA42900")); MenuGroups.Add(group1); MenuGroups.Add(group2); MenuGroups.Add(group3); MenuGroups.Add(GetMyMangaGroup().Result); return MenuGroups; } else { //My Favourtie MenuGroups.Add(GetMyMangaGroup().Result); //最新 MenuGroups.Add(GetNewMangeGroup().Result); //热门 MenuGroups.Add(GetTopMangaGroup().Result); //MenuGroups.Add(); return MenuGroups; } }); }
public Task<HubMenuGroup> GetMyMangaGroup() { return Task.Run<HubMenuGroup>(() => { var group = new HubMenuGroup(MenuType.MyFavourite.ToString(), "我的收藏", string.Empty, string.Empty, string.Empty); List<MangaMenuItem> menuList = SettingService.GetMyMangaMenuList(); ObservableCollection<MangaMenuItem> myMangaMenu = new ObservableCollection<MangaMenuItem>(); foreach (MangaMenuItem mi in menuList) { mi.SetDefaultSize(); group.Items.Add(mi); } return group; }); }
public Task<HubMenuGroup> GetTopMangaGroup() { return Task.Run<HubMenuGroup>(() => { var group = new HubMenuGroup(MenuType.TopManga.ToString(), "热门连载", string.Empty, string.Empty, string.Empty); ObservableCollection<MangaMenuItem> topMangaMenu = new ObservableCollection<MangaMenuItem>(); MangaPattern mPattern = WebSiteAccess.GetMangaPatternInstance(WebType); List<TitleAndUrl> topMenuList = mPattern.GetTopMangaList(MenuHtml); List<Size> sizeArray = new List<Size>() { HubItemSizes.FocusItem, HubItemSizes.SecondarySmallItem, HubItemSizes.SecondarySmallItem, HubItemSizes.SecondarySmallItem }; List<string> colorArray = new List<string>() { "#FF00B1EC", "#FFA80032", "#FFA80032", "#FFA80032" }; if (topMenuList != null) { for (int i = 0; i < topMenuList.Count; i++) { MangaMenuItem newItem = null; if (i >= sizeArray.Count) { //大于则用HubItemSizes.OtherSmallItem newItem = new MangaMenuItem("top-" + i, topMenuList[i].Title, topMenuList[i].ImagePath, group, topMenuList[i].Url, HubItemSizes.OtherSmallItem, string.Empty); } else { newItem = new MangaMenuItem("top-" + i, topMenuList[i].Title, topMenuList[i].ImagePath, group, topMenuList[i].Url, sizeArray[i], colorArray[i]); } group.Items.Add(newItem); } } return group; }); }