-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLocalizedString.cs
More file actions
34 lines (28 loc) · 958 Bytes
/
Copy pathLocalizedString.cs
File metadata and controls
34 lines (28 loc) · 958 Bytes
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
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace AWSServerSelector
{
public class LocalizedString : INotifyPropertyChanged
{
private string _key;
private object[] _args;
public LocalizedString(string key, params object[] args)
{
_key = key;
_args = args;
}
public string Value => _args?.Length > 0
? LocalizationManager.GetString(_key, _args)
: LocalizationManager.GetString(_key);
public event PropertyChangedEventHandler? PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public static implicit operator string(LocalizedString localizedString)
{
return localizedString.Value;
}
}
}