-
Notifications
You must be signed in to change notification settings - Fork 805
Expand file tree
/
Copy pathFirewallProtocolToStringConverter.cs
More file actions
41 lines (38 loc) · 1.45 KB
/
FirewallProtocolToStringConverter.cs
File metadata and controls
41 lines (38 loc) · 1.45 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
39
40
41
using System;
using System.Globalization;
using System.Windows.Data;
using NETworkManager.Localization;
using NETworkManager.Models.Firewall;
namespace NETworkManager.Converters;
/// <summary>
/// Convert <see cref="FirewallProtocol" /> to translated <see cref="string" /> or vice versa.
/// </summary>
public sealed class FirewallProtocolToStringConverter : IValueConverter
{
/// <summary>
/// Convert <see cref="FirewallProtocol" /> to translated <see cref="string" />.
/// </summary>
/// <param name="value">Object from type <see cref="FirewallProtocol" />.</param>
/// <param name="targetType"></param>
/// <param name="parameter"></param>
/// <param name="culture"></param>
/// <returns>Translated <see cref="FirewallProtocol" />.</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value is not FirewallProtocol protocol
? "-/-"
: ResourceTranslator.Translate(ResourceIdentifier.FirewallProtocol, protocol);
}
/// <summary>
/// !!! Method not implemented !!!
/// </summary>
/// <param name="value"></param>
/// <param name="targetType"></param>
/// <param name="parameter"></param>
/// <param name="culture"></param>
/// <returns></returns>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}