Files
DP44/DataPRO/Modules/Hardware/AddEditHardware/.svn/pristine/e1/e104442d5e3b8cc518ebffcde1bd3f24cc679f44.svn-base

22 lines
663 B
Plaintext
Raw Normal View History

2026-04-17 14:55:32 -04:00
using System;
using System.Windows.Markup;
using AddEditHardware.Resources;
namespace AddEditHardware
{
[MarkupExtensionReturnType(typeof(string))]
public class TranslateExtension : MarkupExtension
{
private readonly string _key;
public TranslateExtension(string key) { _key = key; }
private const string NotFound = "#stringnotfound#";
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (string.IsNullOrEmpty(_key)) { return NotFound; }
return StringResources.ResourceManager.GetString(_key) ?? NotFound + " " + _key;
}
}
}