Exemple #1
0
        private void 检查重复皮肤()
        {
            var skins = _skin.AllSkins();

            if (skins.Any(d => d.SkinName == Skin.SkinName && d.Hero == Skin.Hero))
            {
                switch (AyMessageBox.Show("已存在名字为 " + Skin.SkinName + " 的同名皮肤,是否覆盖保存?\r选择是:将覆盖旧皮肤保存\r选择否:将不覆盖旧皮肤保存\r选择取消:将取消导入", "重复皮肤", MessageBoxButton.YesNoCancel))
                {
                case MessageBoxResult.Yes:
                    Skin = skins.FirstOrDefault(d => d.SkinName == Skin.SkinName);
                    break;

                case MessageBoxResult.No:
                    Skin.SkinName = Skin.SkinName + "[副本]";
                    break;

                default:
                    AyMessageBox.Show("取消对当前皮肤" + Skin.SkinName + "的导入!", "取消导入!");
                    _canGoOn = false;
                    break;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// 获取有皮肤的英雄
        /// </summary>
        /// <returns></returns>
        public List <Champions> GetSkinHero()
        {
            var heros = (from c in _skin.AllSkins() select c.Hero).ToList();

            return(_champions.GetAll().Where(d => heros.Contains(d.Name)).ToList());
        }