mirror of
https://github.com/StockSharp/StockSharp.git
synced 2026-12-06 01:22:11 +00:00
Source codes for Messages, BE, Algo, Xaml, Localization, Logging, Community and few connectors (SmartCOM, AlfaDirect, Transaq, BTCE, OpenECry, LMAX, MatLab, CQG, Sterling, RSS, Alor)
33 lines
933 B
C#
33 lines
933 B
C#
namespace StockSharp.Localization
|
|
{
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
|
|
/// <summary>
|
|
/// Specifies a description for a property or event.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.All)]
|
|
public class DescriptionLocAttribute : DescriptionAttribute
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of DescriptionLocAttribute class with description.
|
|
/// </summary>
|
|
/// <param name="resourceId">Id of string resource.</param>
|
|
/// <param name="appendDot">Append dot character ('.') at the end of description. Ignore by default.</param>
|
|
public DescriptionLocAttribute(string resourceId, bool appendDot = false)
|
|
: base(GetDescription(resourceId, appendDot))
|
|
{
|
|
}
|
|
|
|
private static string GetDescription(string resourceId, bool appendDot)
|
|
{
|
|
var desc = LocalizedStrings.GetString(resourceId);
|
|
|
|
if (appendDot && desc.Last() != '.')
|
|
desc += '.';
|
|
|
|
return desc;
|
|
}
|
|
}
|
|
} |