Files
C4IT-F4SD-Client/FasdDesktopUi/Basics/Services/ProtocollService/QuickTipStepProtocollEntry.cs
2025-11-11 11:03:42 +01:00

36 lines
1.3 KiB
C#

using C4IT.FASD.Base;
using C4IT.MultiLanguage;
namespace FasdDesktopUi.Basics.Services.ProtocollService
{
internal class QuickTipStepProtocollEntry : IProtocollEntry
{
private readonly cQuickTipElement _quickTipElementDefinition;
private readonly bool _wasSuccessfull;
public QuickTipStepProtocollEntry(cQuickTipElement quickTipElementDefinition, bool wasSuccessfull)
{
_quickTipElementDefinition = quickTipElementDefinition;
_wasSuccessfull = wasSuccessfull;
}
public string GetAscii()
{
string currentLanguage = cMultiLanguageSupport.CurrentLanguage;
try
{
cMultiLanguageSupport.CurrentLanguage = cF4SDCockpitXmlConfig.Instance.HealthCardConfig.ProtocollLanguage ?? currentLanguage;
string ascii = _wasSuccessfull ? cMultiLanguageSupport.GetItem("QuickTips.Copy.ManualStep.Successfull") : cMultiLanguageSupport.GetItem("QuickTips.Copy.ManualStep.Unsuccessfull");
return string.Format(ascii, _quickTipElementDefinition?.Names?.GetValue());
}
finally
{
cMultiLanguageSupport.CurrentLanguage = currentLanguage;
}
}
public string GetHtml()
=> GetAscii();
}
}