public Alert(AlertDescription description)
{
- this.inferAlertLevel();
this.description = description;
+ this.level = inferAlertLevel(description);
}
public Alert(
#region Private Methods
- private void inferAlertLevel()
+ private static AlertLevel inferAlertLevel(AlertDescription description)
{
switch (description)
{
case AlertDescription.CloseNotify:
case AlertDescription.NoRenegotiation:
case AlertDescription.UserCancelled:
- this.level = AlertLevel.Warning;
- break;
+ return AlertLevel.Warning;
case AlertDescription.AccessDenied:
case AlertDescription.BadCertificate:
case AlertDescription.UnknownCA:
case AlertDescription.UnsupportedCertificate:
default:
- this.level = AlertLevel.Fatal;
- break;
+ return AlertLevel.Fatal;
}
}