Ejemplo n.º 1
0
        private void AddInfoToList(BestiaryEntry entry, ExtraBestiaryInfoPageInformation extraInfo)
        {
            BestiaryUICollectionInfo uiCollectionInfo = this.GetUICollectionInfo(entry, extraInfo);
            IOrderedEnumerable <IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement> > orderedEnumerable = new List <IBestiaryInfoElement>((IEnumerable <IBestiaryInfoElement>)entry.Info).GroupBy <IBestiaryInfoElement, UIBestiaryEntryInfoPage.BestiaryInfoCategory>(new Func <IBestiaryInfoElement, UIBestiaryEntryInfoPage.BestiaryInfoCategory>(this.GetBestiaryInfoCategory)).OrderBy <IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement>, UIBestiaryEntryInfoPage.BestiaryInfoCategory>((Func <IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement>, UIBestiaryEntryInfoPage.BestiaryInfoCategory>)(x => x.Key));
            UIElement uiElement1 = (UIElement)null;

            foreach (IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement> source in (IEnumerable <IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement> >)orderedEnumerable)
            {
                if (source.Count <IBestiaryInfoElement>() != 0)
                {
                    bool flag = false;
                    foreach (IBestiaryInfoElement bestiaryInfoElement in (IEnumerable <IBestiaryInfoElement>)source)
                    {
                        UIElement uiElement2 = bestiaryInfoElement.ProvideUIElement(uiCollectionInfo);
                        if (uiElement2 != null)
                        {
                            this._list.Add(uiElement2);
                            flag = true;
                        }
                    }
                    if (flag)
                    {
                        UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(2, true);
                        horizontalSeparator1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f);
                        horizontalSeparator1.Color = new Color(89, 116, 213, (int)byte.MaxValue) * 0.9f;
                        UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1;
                        this._list.Add((UIElement)horizontalSeparator2);
                        uiElement1 = (UIElement)horizontalSeparator2;
                    }
                }
            }
            this._list.Remove(uiElement1);
        }
Ejemplo n.º 2
0
        private BestiaryUICollectionInfo GetUICollectionInfo(BestiaryEntry entry, ExtraBestiaryInfoPageInformation extraInfo)
        {
            BestiaryUICollectionInfo result = entry.UIInfoProvider?.GetEntryUICollectionInfo() ?? default(BestiaryUICollectionInfo);

            result.OwnerEntry = entry;
            return(result);
        }
Ejemplo n.º 3
0
 public void FillInfoForEntry(BestiaryEntry entry, ExtraBestiaryInfoPageInformation extraInfo)
 {
     _list.Clear();
     if (entry != null)
     {
         AddInfoToList(entry, extraInfo);
         Recalculate();
     }
 }
Ejemplo n.º 4
0
        private BestiaryUICollectionInfo GetUICollectionInfo(
            BestiaryEntry entry,
            ExtraBestiaryInfoPageInformation extraInfo)
        {
            IBestiaryUICollectionInfoProvider uiInfoProvider   = entry.UIInfoProvider;
            BestiaryUICollectionInfo          uiCollectionInfo = uiInfoProvider == null ? new BestiaryUICollectionInfo() : uiInfoProvider.GetEntryUICollectionInfo();

            uiCollectionInfo.OwnerEntry = entry;
            return(uiCollectionInfo);
        }
Ejemplo n.º 5
0
 public void FillInfoForEntry(BestiaryEntry entry, ExtraBestiaryInfoPageInformation extraInfo)
 {
     this._list.Clear();
     if (entry == null)
     {
         return;
     }
     this.AddInfoToList(entry, extraInfo);
     this.Recalculate();
 }
Ejemplo n.º 6
0
        private void AddInfoToList(BestiaryEntry entry, ExtraBestiaryInfoPageInformation extraInfo)
        {
            BestiaryUICollectionInfo uICollectionInfo = GetUICollectionInfo(entry, extraInfo);
            IOrderedEnumerable <IGrouping <BestiaryInfoCategory, IBestiaryInfoElement> > orderedEnumerable = from x in new List <IBestiaryInfoElement>(entry.Info).GroupBy(GetBestiaryInfoCategory)
                                                                                                             orderby x.Key
                                                                                                             select x;
            UIElement item = null;

            foreach (IGrouping <BestiaryInfoCategory, IBestiaryInfoElement> item2 in orderedEnumerable)
            {
                if (item2.Count() == 0)
                {
                    continue;
                }
                bool flag = false;
                foreach (IBestiaryInfoElement item3 in item2)
                {
                    UIElement uIElement = item3.ProvideUIElement(uICollectionInfo);
                    if (uIElement != null)
                    {
                        _list.Add(uIElement);
                        flag = true;
                    }
                }
                if (flag)
                {
                    UIHorizontalSeparator uIHorizontalSeparator = new UIHorizontalSeparator
                    {
                        Width = StyleDimension.FromPixelsAndPercent(0f, 1f),
                        Color = new Color(89, 116, 213, 255) * 0.9f
                    };
                    _list.Add(uIHorizontalSeparator);
                    item = uIHorizontalSeparator;
                }
            }
            _list.Remove(item);
        }