forked from PeterWaher/IoTGateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LanguageString.cs
89 lines (80 loc) · 1.66 KB
/
LanguageString.cs
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Waher.Persistence;
using Waher.Persistence.Attributes;
namespace Waher.Runtime.Language
{
/// <summary>
/// Contains a localized string.
/// </summary>
[CollectionName("LanguageStrings")]
[Index("NamespaceId", "Id")]
[TypeName(TypeNameSerialization.None)]
public class LanguageString
{
private Guid objectId = Guid.Empty;
private Guid namespaceId = Guid.Empty;
private int id = 0;
private string value = string.Empty;
private bool untranslated = false;
/// <summary>
/// Contains information about a namespace in a language.
/// </summary>
public LanguageString()
{
}
/// <summary>
/// Object ID
/// </summary>
[ObjectId]
public Guid ObjectId
{
get { return this.objectId; }
set { this.objectId = value; }
}
/// <summary>
/// Namespace ID.
/// </summary>
public Guid NamespaceId
{
get { return this.namespaceId; }
set { this.namespaceId = value; }
}
/// <summary>
/// String ID.
/// </summary>
[DefaultValue(0)]
public int Id
{
get { return this.id; }
set { this.id = value; }
}
/// <summary>
/// Localized value.
/// </summary>
[DefaultValueStringEmpty]
public string Value
{
get { return this.value; }
set { this.value = value; }
}
/// <summary>
/// If the string is untranslated.
/// </summary>
[DefaultValue(false)]
public bool Untranslated
{
get { return this.untranslated; }
set { this.untranslated = value; }
}
/// <summary>
/// <see cref="object.ToString()"/>
/// </summary>
public override string ToString()
{
return this.value;
}
}
}