Пример #1
0
        private DeckPickerItem GetDeckPickerItemFromCache(Deck deck)
        {
            DeckPickerItem dpi;

            if (_cachedDeckPickerItems.TryGetValue(deck, out dpi))
            {
                return(dpi);
            }
            Type layout;

            switch (Config.Instance.DeckPickerItemLayout)
            {
            case DeckLayout.Layout1:
                layout = typeof(DeckPickerItemLayout1);
                break;

            case DeckLayout.Layout2:
                layout = typeof(DeckPickerItemLayout2);
                break;

            case DeckLayout.Legacy:
                layout = typeof(DeckPickerItemLayoutLegacy);
                break;

            default:
                layout = typeof(DeckPickerItemLayout1);
                break;
            }
            dpi = new DeckPickerItem(deck, layout);
            _cachedDeckPickerItems.Add(deck, dpi);
            return(dpi);
        }
		private DeckPickerItem GetDeckPickerItemFromCache(Deck deck)
		{
			DeckPickerItem dpi;
			if(_cachedDeckPickerItems.TryGetValue(deck, out dpi))
				return dpi;
			Type layout;
			switch(Config.Instance.DeckPickerItemLayout)
			{
				case DeckLayout.Layout1:
					layout = typeof(DeckPickerItemLayout1);
					break;
				case DeckLayout.Layout2:
					layout = typeof(DeckPickerItemLayout2);
					break;
				case DeckLayout.Legacy:
					layout = typeof(DeckPickerItemLayoutLegacy);
					break;
				default:
					layout = typeof(DeckPickerItemLayout1);
					break;
			}
			dpi = new DeckPickerItem(deck, layout);
			_cachedDeckPickerItems.Add(deck, dpi);
			return dpi;
		}