RestoreCallerCulture
Methode (Function) · gibt Boolean zurück
RestoreCallerCulture ist eine Methode der Klasse Aloaha_ZUGFeRD.XML im Aloaha ZUGFeRD SDK.
Beschreibung (Originaltext der englischen SDK-Dokumentation): Gives the calling thread its own culture (CultureInfo) back. Creating an XML object sets the thread culture to en-US; this call restores the culture the thread had before and keeps it that way: from then on the object switches to en-US only while one of its main calls runs (SaveXML, FillZUGFeRD_Structure, MergeXMLIntoPDF, MergeXMLIntoPDFWait4PDF, CreateDocFromXML, ConvertDOCX2PDF, ImportCSV, CreateCSV, GetZUGFeRD_XMLfromPDF, ValidateInvoiceXML, ValidateInvoicePDF, ValidateInvoiceXMLString, CheckPDFTextAgainstXML) and switches back afterwards. Call it once directly after creating the object. Relevant for .NET callers only; COM clients (VB6, VBA, Delphi) do not see the thread culture. Available from version 11.0.0.25.
Rückgabe: True if the thread culture was changed back; False if there was nothing to restore (the mode is switched on in both cases)
Hinweis: Amounts, quantities and dates are still passed to the SDK as text with a decimal point (e.g. "1234.56"), independent of the thread culture. Without this call the behaviour is unchanged: the thread culture stays en-US until UnloadEverything or Dispose.
Deklaration
Public Function RestoreCallerCulture() As Boolean
Aufruf (VB.NET)
Dim alo As New Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, False, "IHR-LIZENZSCHLUESSEL")
If Not alo.RestoreCallerCulture() Then
Console.WriteLine("Fehler: " & alo.Last_Error)
End If
Aufruf (C#)
var zfStandard = Aloaha_ZUGFeRD.iXML.ZUGFeRDVersion.xInvoice; // Optional ByRef im Konstruktor: in C# mit ref übergeben
var alo = new Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, false, "IHR-LIZENZSCHLUESSEL", ref zfStandard);
if (!alo.RestoreCallerCulture())
{
Console.WriteLine("Fehler: " + alo.Last_Error);
}