static string GetDiagnostic(SourceDiagnostic diagnostic)
{
if (diagnostic == SourceDiagnostic.NoReasonGiven)
{
return "No reason is given.";
}
if (diagnostic == SourceDiagnostic.ApplicationContextNameNotSupported)
{
return "The application context name is not supported.";
}
if (diagnostic == SourceDiagnostic.AuthenticationMechanismNameNotRecognised)
{
return "The authentication mechanism name is not recognized.";
}
if (diagnostic == SourceDiagnostic.AuthenticationMechanismNameReguired)
{
return "Authentication mechanism name is required.";
}
if (diagnostic == SourceDiagnostic.AuthenticationFailure)
{
return "Authentication failure.";
}
if (diagnostic == SourceDiagnostic.AuthenticationRequired)
{
return "Authentication is required.";
}
throw new InvalidOperationException();
}