Exemplo n.º 1
0
        private void RemoveGuildToBan(object sender, RoutedEventArgs e)
        {
            var guildForRemove =
                BannedGuilds.FirstOrDefault(
                    guild =>
                    guild.Name.ToLower() == GuildNameTextBox.Text.ToLower() &&
                    guild.Name.ToLower() == SelectedGuildServerName.ToLower());

            if (guildForRemove == null)
            {
                MessageBox.Show("Гильдия не найдена");
                return;
            }

            BannedGuilds.Remove(guildForRemove);
        }
Exemplo n.º 2
0
        private void UpdateBannedGuildsAndPeoples()
        {
            foreach (var bannedGuild in BannedGuilds.ToArray())
            {
                var guild = _explorer.GetGuild(Region.EU, bannedGuild.Realm, bannedGuild.Name,
                                               GuildOptions.GetMembers);

                Parallel.ForEach(guild.Members, member =>
                {
                    member.FullCharactor = _explorer.GetCharacter(Region.EU, member.GuildCharacter.Realm,
                                                                  member.GuildCharacter.Name, CharacterOptions.GetPetSlots);
                });

                BannedGuilds.Remove(bannedGuild);
                BannedGuilds.Add(guild);
            }

            foreach (var bannedPlayer in BannedPlayers.ToArray())
            {
                var updated = _explorer.GetCharacter(bannedPlayer.Realm, bannedPlayer.Name, CharacterOptions.GetPetSlots);
                BannedPlayers.Remove(bannedPlayer);
                BannedPlayers.Add(updated);
            }
        }