Не все пути кода возвращают значение - где?
У меня есть следующий код C #. По причинам, которые я выигралНе вдавайтесь, это обязательный способ локализации.
Моя проблема в том, что я не могу на всю жизнь понять, какой путь не возвращает значение. Других ошибок в приведенном ниже коде нет:
ResourceManager ResMain = new ResourceManager("TorrentSched.Main", typeof(Main).Assembly);
/// Returns a localised string based on the Current UI Culture
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!";
}
}
}