Messages, Notifications, Log, Exceptions, Translation

Translation guideline

xMessgeBox.Show and LoggerSink.PushMessage go through l.Translate with success only if they contain strings without parameters.

Any parameter requires an explicit call of l.Translate (which is similar to a string.format command).

Exceptions and messages with arguments need l.Translate.

throw new Exception(l.Translate("Mehrwertsteuer Array konnte nicht berechnet werden."));
xMessageBox.Show(l.Translate("Gebinde nicht vorhanden),....);

Yes/No

answer = xMessageBox.Show(l.Translate("Gebinde nicht vorhanden. Soll es erstellt werden?"), "Abfrage", MessageBoxButton.YesNo);
if (answer == MessageBoxResult.Yes)
{
    //Create container
    this.CreateGebinde(gebindeNr);
    return;
}

LoggerSink

LoggerSink [deprecated]

Exceptions

If more than a Message (a string) is needed after an exception occurred, we can use custom exceptions.

Example for creating such an exception:

Handling the exception:

Last updated