-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better UI rendering of DESFire/SAM key types enums
- Loading branch information
Showing
6 changed files
with
89 additions
and
29 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
KeyManager.Library.KeyStore.NXP_SAM.UI/Domain/DESFireKeyTypeConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Domain | ||
{ | ||
public class DESFireKeyTypeConverter : IValueConverter | ||
{ | ||
public static string GetKeyTypeName(LibLogicalAccess.Card.DESFireKeyType keyType) | ||
{ | ||
return keyType switch | ||
{ | ||
LibLogicalAccess.Card.DESFireKeyType.DF_KEY_DES => "DES", | ||
LibLogicalAccess.Card.DESFireKeyType.DF_KEY_3K3DES => "TK3DES", | ||
_ => "AES128", | ||
}; | ||
} | ||
|
||
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is LibLogicalAccess.Card.DESFireKeyType kt) | ||
{ | ||
return GetKeyTypeName(kt); | ||
} | ||
return string.Empty; | ||
} | ||
|
||
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return string.Empty; | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
KeyManager.Library.KeyStore.NXP_SAM.UI/Domain/SAMKeyTypeConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Domain | ||
{ | ||
public class SAMKeyTypeConverter : IValueConverter | ||
{ | ||
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is LibLogicalAccess.Card.SAMKeyType kt) | ||
{ | ||
return SAMKeyStore.GetVariantName(kt); | ||
} | ||
return string.Empty; | ||
} | ||
|
||
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return string.Empty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"VersionString": "1.15.0", | ||
"Uri": "https://download.leosac.com/lkm/KeyManager.Setup-1.15.0.msi" | ||
"VersionString": "1.16.1", | ||
"Uri": "https://download.leosac.com/lkm/KeyManager.Setup-1.16.1.msi" | ||
} |