Nejlepší by bylo do třídy skola přidat metodu, která vrátí správnou osobou.
Ale prasácké rešení může být např.:
student student;
ucitel ucitel;
do
{
skola.AktualniIndex--;
osoba osoba = skola.Aktualni;
bool found;
if (rb_student.IsChecked)
{
student = osoba as student;
if (student != null)
break;
}
if (rb_ucitel.IsChecked)
{
ucitel = osoba as ucitel;
if (ucitel != null)
break;
}
} while (true)