Files
DP44/Common/DTS.CommonCore/.svn/pristine/87/873e9c4b025e8e6b55c9b92587b502f7fc5f771d.svn-base

21 lines
871 B
Plaintext
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
using System.ComponentModel;
namespace DTS.Common.Base.Classes
{
/// <summary>
/// this class overloads the description attribute to allow us to use an enum
/// to set the description and to lookup the description in the string resources
/// to be translated the property should have a string resource in the form of PropertyName_Description
/// otherwise ##DescriptionNotFound## will be returned as the translated string
/// </summary>
public class DescriptionResourceAttribute : DescriptionAttribute
{
private string _resourceId;
public DescriptionResourceAttribute(string resourceId)
{
_resourceId = resourceId;
}
public override string Description => Strings.Strings.ResourceManager.GetString(_resourceId) ?? @"##DescriptionNotFound##" + _resourceId;
}
}