示例#1
0
        protected OemQuickLink GetBestQuickLink()
        {
            List <IQuickLink> list = new List <IQuickLink>();
            Dictionary <IQuickLink, OemCategory> dictionary = new Dictionary <IQuickLink, OemCategory>();

            foreach (string index in this.categories)
            {
                OemCategory oemCategory = this.Manager.OemManager.Categories[index];
                if (oemCategory != null)
                {
                    IQuickLink newestQuickLink = PartnerQuickLink.GetNewestQuickLink((IList <IQuickLink>)oemCategory.QuickLinks);
                    if (newestQuickLink != null)
                    {
                        list.Add(newestQuickLink);
                        dictionary[newestQuickLink] = oemCategory;
                    }
                }
            }
            if (list.Count > 0)
            {
                IQuickLink newestQuickLink = PartnerQuickLink.GetNewestQuickLink((IList <IQuickLink>)list);
                this.category = dictionary[newestQuickLink];
                return((OemQuickLink)newestQuickLink);
            }
            else
            {
                this.category = this.Manager.OemManager.Categories[this.categories[0]];
                return((OemQuickLink)null);
            }
        }
示例#2
0
 private static IQuickLink GetNewestQuickLink(IList <IQuickLink> links)
 {
     return(PartnerQuickLink.GetNewestQuickLink(links, true) ?? PartnerQuickLink.GetNewestQuickLink(links, false));
 }