Nicht alle Codepfade geben einen Wert zurück - wo?

Ich habe den folgenden C # -Code. Aus Gründen, auf die ich nicht näher eingehen möchte, ist dies die erforderliche Art der Lokalisierung.

Mein Problem ist, ich kann für mein ganzes Leben nicht herausfinden, welcher Pfad keinen Wert zurückgibt. Der folgende Code enthält keine weiteren Fehler:

ResourceManager ResMain = new ResourceManager("TorrentSched.Main", typeof(Main).Assembly);
/// <summary>Returns a localised string based on the Current UI Culture</summary>
public string Str(string Name)
{
    Boolean StringNotFound = false;
    switch(Thread.CurrentThread.CurrentUICulture.ToString())
    {
        case "en-GB":
            switch(Name)
            {
                case "MinimizeToTray": return "Closing the program minimises it to the tray. To fully quit the program, right-click the icon in your tray and choose Exit.";
                default: StringNotFound = true; break;
            }
        break;
        default:
            StringNotFound = true;
        break;
    }

    if(StringNotFound)
    {
        StringNotFound = false;
        switch(Name)
        {
            case "AppName":         return ResMain.GetString("$this.Text");
            case "MinimizeToTray":  return "Closing the program minimizes it to the tray. To fully quit the program, right-click the icon in your tray and choose Exit.";
            case "ReallyExit1":     return "Do you really want to exit?";
            case "ReallyExit2":     return "Torrents will not be checked and downloaded until you launch the program again!";
            default:                return "String not found!";
        }
    }
}

Antworten auf die Frage(7)

Ihre Antwort auf die Frage