diff options
Diffstat (limited to 'src/WixToolset.Data/LocalizedControl.cs')
-rw-r--r-- | src/WixToolset.Data/LocalizedControl.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/WixToolset.Data/LocalizedControl.cs b/src/WixToolset.Data/LocalizedControl.cs new file mode 100644 index 00000000..50315b29 --- /dev/null +++ b/src/WixToolset.Data/LocalizedControl.cs | |||
@@ -0,0 +1,57 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Data | ||
4 | { | ||
5 | using System; | ||
6 | |||
7 | public class LocalizedControl | ||
8 | { | ||
9 | public LocalizedControl(string dialog, string control, int x, int y, int width, int height, int attribs, string text) | ||
10 | { | ||
11 | this.Dialog = dialog; | ||
12 | this.Control = control; | ||
13 | this.X = x; | ||
14 | this.Y = y; | ||
15 | this.Width = width; | ||
16 | this.Height = height; | ||
17 | this.Attributes = attribs; | ||
18 | this.Text = text; | ||
19 | } | ||
20 | |||
21 | public string Dialog { get; set; } | ||
22 | |||
23 | public string Control { get; set; } | ||
24 | |||
25 | public int X { get; private set; } | ||
26 | |||
27 | public int Y { get; private set; } | ||
28 | |||
29 | public int Width { get; private set; } | ||
30 | |||
31 | public int Height { get; private set; } | ||
32 | |||
33 | public int Attributes { get; private set; } | ||
34 | |||
35 | public string Text { get; private set; } | ||
36 | |||
37 | /// <summary> | ||
38 | /// Get key for a localized control. | ||
39 | /// </summary> | ||
40 | /// <returns>The localized control id.</returns> | ||
41 | public string GetKey() | ||
42 | { | ||
43 | return LocalizedControl.GetKey(this.Dialog, this.Control); | ||
44 | } | ||
45 | |||
46 | /// <summary> | ||
47 | /// Get key for a localized control. | ||
48 | /// </summary> | ||
49 | /// <param name="dialog">The optional id of the control's dialog.</param> | ||
50 | /// <param name="control">The id of the control.</param> | ||
51 | /// <returns>The localized control id.</returns> | ||
52 | public static string GetKey(string dialog, string control) | ||
53 | { | ||
54 | return String.Concat(String.IsNullOrEmpty(dialog) ? String.Empty : dialog, "/", String.IsNullOrEmpty(control) ? String.Empty : control); | ||
55 | } | ||
56 | } | ||
57 | } | ||