var fileStream = new FileStream(XMLFileName, FileMode.Open);
XmlSerializer serializer = new XmlSerializer(typeof(Members));
var _nds = (Members)serializer.Deserialize(fileStream);
if (_nds.Radiostation.Title == MainForm.nameStation)
{
editTitleRadiostation.Text = _nds.Radiostation.Name;
editCountryPanel.Text = _nds.Radiostation.Country;
editGenrePanel.Text = _nds.Radiostation.Genre;
editSubGenrePanel.Text = _nds.Radiostation.Subgenre;
editUrlPanel.Text = _nds.Radiostation.Urlwww;
editIcoPanel.Text = _nds.Radiostation.Ico;
}
fileStream.Close();
<?xml version="1.0" encoding="utf-8" ?>
<users>
<radiostation name="radiostation1">
<country>Латвия</country>
<genre>Поп</genre>
<subgenre />
<title>Сконто</title>
<urlwww>1</urlwww>
<ico />
</radiostation>
<radiostation name="radiostation2">
<country>Россия</country>
<genre>Разное</genre>
<subgenre />
<title>Монтекарло</title>
<urlwww>1</urlwww>
<ico />
</radiostation>
<radiostation name="radiostation2">
<country>Россия</country>
<genre>Релакс, Легкая музыка</genre>
<subgenre />
<title>Радио рекорд</title>
<urlwww>1</urlwww>
<ico />
</radiostation>
</users>
var fileStream = new FileStream(XMLFileName, FileMode.Open);
XmlSerializer serializer = new XmlSerializer(typeof(Members));
var _nds = (Members)serializer.Deserialize(fileStream);
editTitleRadiostation.Text = _nds.Radiostation.Name;
listRadiostation.DataSource = null;
IEnumerable<RadioStation> stations = radioStations;
var station = (RadioStation)listRadiostation.SelectedItem;
textBox1.Text = station.ToString();
textBox1.Text = station.Title.ToString();
listRadiostation.DataSource = null;
IEnumerable<RadioStation> stations = radioStations;
string urItemText = stations[listRadiostation.SelectedIndex];
textBox1.Text = urItemText;