From 4ebc33174c02e1c9f5693b5ef38ecfe3292c687f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 11 Aug 2017 00:39:04 -0700 Subject: Move to .NET Core 2.0 --- src/WixToolset.Data/LocalizedControl.cs | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/WixToolset.Data/LocalizedControl.cs (limited to 'src/WixToolset.Data/LocalizedControl.cs') 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 @@ +// 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. + +namespace WixToolset.Data +{ + using System; + + public class LocalizedControl + { + public LocalizedControl(string dialog, string control, int x, int y, int width, int height, int attribs, string text) + { + this.Dialog = dialog; + this.Control = control; + this.X = x; + this.Y = y; + this.Width = width; + this.Height = height; + this.Attributes = attribs; + this.Text = text; + } + + public string Dialog { get; set; } + + public string Control { get; set; } + + public int X { get; private set; } + + public int Y { get; private set; } + + public int Width { get; private set; } + + public int Height { get; private set; } + + public int Attributes { get; private set; } + + public string Text { get; private set; } + + /// + /// Get key for a localized control. + /// + /// The localized control id. + public string GetKey() + { + return LocalizedControl.GetKey(this.Dialog, this.Control); + } + + /// + /// Get key for a localized control. + /// + /// The optional id of the control's dialog. + /// The id of the control. + /// The localized control id. + public static string GetKey(string dialog, string control) + { + return String.Concat(String.IsNullOrEmpty(dialog) ? String.Empty : dialog, "/", String.IsNullOrEmpty(control) ? String.Empty : control); + } + } +} -- cgit v1.2.3-55-g6feb