public void ApplyLocalizationToString(object control, string id, string localization)
{
if ((control as Control) == null || string.IsNullOrEmpty(id) || string.IsNullOrEmpty(localization))
return;
var subControl = control as Control;
var normalTip = GetToolTip(subControl);
SetToolTip(subControl, null); // setting the tooltip to null helps us get it to refresh dynamically
var isDisabledToolTip = id.EndsWith(DISABLED_TIP);
if (isDisabledToolTip)
{
// setting an existing TipWhenDisabled throws a dictionary exception,
// so we need to remove the existing one first
SetToolTipWhenDisabled(subControl, null);
SetToolTipWhenDisabled(subControl, localization);
SetToolTip(subControl, normalTip);
}
else
{
SetToolTip(subControl, localization);
}
}