-
-
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.
Add DESFire authentication tool with SAM AV
- Loading branch information
Showing
11 changed files
with
486 additions
and
53 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
KeyManager.Library.KeyStore.NXP_SAM.UI/Domain/LLAReaderViewModel.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,36 @@ | ||
using System.Collections.ObjectModel; | ||
|
||
namespace Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Domain | ||
{ | ||
public class LLAReaderViewModel | ||
{ | ||
private readonly LibLogicalAccess.LibraryManager _lla; | ||
|
||
public LLAReaderViewModel() | ||
{ | ||
_lla = LibLogicalAccess.LibraryManager.getInstance(); | ||
ReaderProviders = new ObservableCollection<string>(_lla.getAvailableReaders().ToArray()); | ||
ReaderUnits = new ObservableCollection<string>(); | ||
} | ||
|
||
public ObservableCollection<string> ReaderProviders { get; set; } | ||
|
||
public ObservableCollection<string> ReaderUnits { get; set; } | ||
|
||
public void RefreshReaderList(LLAReaderControl config) | ||
{ | ||
var prevru = config!.ReaderUnit; | ||
ReaderUnits.Clear(); | ||
var rp = _lla.getReaderProvider(config.ReaderProvider); | ||
var ruList = rp.getReaderList(); | ||
foreach (var ru in ruList) | ||
{ | ||
ReaderUnits.Add(ru.getName()); | ||
} | ||
if (ReaderUnits.Contains(prevru)) | ||
{ | ||
config.ReaderUnit = prevru; | ||
} | ||
} | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
KeyManager.Library.KeyStore.NXP_SAM.UI/LLAReaderControl.xaml
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,29 @@ | ||
<UserControl x:Class="Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.LLAReaderControl" | ||
x:Name="llaControl" | ||
xmlns="http:https://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http:https://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http:https://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http:https://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:domain="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Domain" | ||
xmlns:local="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI" | ||
xmlns:materialDesign="http:https://materialdesigninxaml.net/winfx/xaml/themes" | ||
xmlns:properties="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Properties" | ||
xmlns:wpfappctrls="clr-namespace:Leosac.WpfApp.Controls;assembly=WpfApp" | ||
mc:Ignorable="d" | ||
d:DataContext="{d:DesignInstance domain:LLAReaderViewModel}" | ||
d:DesignHeight="250" d:DesignWidth="400"> | ||
<StackPanel> | ||
<ComboBox ItemsSource="{Binding ReaderProviders}" SelectedItem="{Binding ReaderProvider, ElementName=llaControl}" | ||
materialDesign:HintAssist.HelperText="{x:Static properties:Resources.ReaderProviderHelper}" | ||
materialDesign:HintAssist.Hint="{x:Static properties:Resources.ReaderProvider}" Margin="5,5,5,10" SelectionChanged="cbReaderProvider_SelectionChanged" /> | ||
<DockPanel LastChildFill="True"> | ||
<Button DockPanel.Dock="Right" x:Name="btnRefreshReaderUnits" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Width="24" Height="24" Margin="3" ToolTip="{x:Static properties:Resources.RefreshReaderUnits}" Click="btnRefreshReaderUnits_Click"> | ||
<materialDesign:PackIcon Kind="Refresh" Height="16" Width="16"/> | ||
</Button> | ||
<ComboBox ItemsSource="{Binding ReaderUnits}" SelectedItem="{Binding ReaderUnit, ElementName=llaControl}" | ||
materialDesign:HintAssist.HelperText="{x:Static properties:Resources.ReaderUnitHelper}" | ||
materialDesign:HintAssist.Hint="{x:Static properties:Resources.ReaderUnit}" | ||
materialDesign:TextFieldAssist.HasClearButton="True" Margin="5,5,5,10" /> | ||
</DockPanel> | ||
</StackPanel> | ||
</UserControl> |
Oops, something went wrong.