-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHelperDescriptionAttribute.cs
More file actions
38 lines (32 loc) · 1.22 KB
/
Copy pathHelperDescriptionAttribute.cs
File metadata and controls
38 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Diagnostics;
namespace TSLab.Script.Handlers.Options
{
/// <summary>
/// Описание кубика как его будет видеть Пользователь.
/// Это вспомогательный атрибут для упрощения локализации зоопарка кубиков (как опционных, так и обычных).
/// </summary>
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class HelperDescriptionAttribute : Attribute
{
public HelperDescriptionAttribute()
: this(String.Empty, Constants.Ru)
{
}
public HelperDescriptionAttribute(string description)
: this(description, Constants.Ru)
{
}
public HelperDescriptionAttribute(string description, string language)
{
Description = description ?? String.Empty;
Language = String.IsNullOrWhiteSpace(language) ? Constants.Ru : language;
}
public string Description { get; set; }
public string Language { get; set; }
public override string ToString()
{
return Description;
}
}
}