有没有更简洁的方法来编写这段代码。我觉得可能有,但我不知道如何。
if (loadedFormData.Education.AwardedADegree==true)
{
this.radiobuttonNoAwarded.Checked = false;
this.radiobuttonYesAwarded.Checked = true;
}
if (loadedFormData.Education.AwardedADegree == false)
{
this.radiobuttonNoAwarded.Checked = true;
this.radiobuttonYesAwarded.Checked = false;
}
else // AwardedADegree is null
{
this.radiobuttonNoAwarded.Checked = false;
this.radiobuttonYesAwarded.Checked = false;
}