private void LoadServerList()
{
//Загружаем новый список серверов
ComboBoxServer.ItemsSource = serversProvider.ServerList;
Profile currentProfile = ProfileManager.CurrentProfile;
//Если есть название гильдии в ротации, вводим его и сервер
if (!string.IsNullOrEmpty(currentProfile.Rotation.Guild)) {
foreach (Server serv in ComboBoxServer.Items) {
//Ищем сервер с нужным идентификатором и выбираем его
if (serv.Identifier == currentProfile.Rotation.ServerId) {
ComboBoxServer.SelectedValue = serv;
break;
}
}
if (string.IsNullOrEmpty(GuildNameTextBox.Text)) {
GuildNameTextBox.Text = currentProfile.Rotation.Guild;
}
} else {
GuildNameTextBox.Clear();
if (ComboBoxServer.Items.Count > 0) {
ComboBoxServer.SelectedIndex = 0;
}
}
}