diff --git a/README.md b/README.md index 722dad7..b051223 100644 --- a/README.md +++ b/README.md @@ -4,33 +4,33 @@ Windows Biometric Framework .NET wrapper [![NuGet version](https://badge.fury.io/nu/WinBiometricDotNet.svg)](https://badge.fury.io/nu/WinBiometricDotNet) [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)]() -[![API Cover Progress](https://img.shields.io/badge/API%20Coverage-84.6%25%20(44/52)-green.svg)]() +[![API Cover Progress](https://img.shields.io/badge/API%20Coverage-100.0%25%20(52/52)-green.svg)]() ## Support API |Function|Support|Win 7|Win 8|Win 10|Note| |----|:----:|:----:|:----:|:----:|----| |WinBioAcquireFocus|✓|✓|✓|✓|| -|WinBioAsyncEnumBiometricUnits|✓||✓|✓|Experimental| -|WinBioAsyncEnumDatabases|✓||✓|✓|Experimental| -|WinBioAsyncEnumServiceProviders|✓||✓|✓|Experimental| -|WinBioAsyncMonitorFrameworkChanges|✓||✓|✓|Experimental| -|WinBioAsyncOpenFramework|✓||✓|✓|Experimental| -|WinBioAsyncOpenSession|✓||✓|✓|Experimental| +|WinBioAsyncEnumBiometricUnits|✓||✓|✓|| +|WinBioAsyncEnumDatabases|✓||✓|✓|| +|WinBioAsyncEnumServiceProviders|✓||✓|✓|| +|WinBioAsyncMonitorFrameworkChanges|✓||✓|✓|| +|WinBioAsyncOpenFramework|✓||✓|✓|| +|WinBioAsyncOpenSession|✓||✓|✓|| |WinBioCancel|✓|✓|✓|✓|| |WinBioCaptureSample|✓|✓|✓|✓|| |WinBioCaptureSampleWithCallback|✓|✓|✓|✓|| |WinBioCloseFramework|✓||✓|✓|| |WinBioCloseSession|✓|✓|✓|✓|| -|WinBioControlUnit||✓|✓|✓|| -|WinBioControlUnitPrivileged||✓|✓|✓|| +|WinBioControlUnit|✓|✓|✓|✓|| +|WinBioControlUnitPrivileged|✓|✓|✓|✓|| |WinBioDeleteTemplate|✓|✓|✓|✓|| |WinBioEnrollBegin|✓|✓|✓|✓|| |WinBioEnrollCapture|✓|✓|✓|✓|| |WinBioEnrollCaptureWithCallback|✓|✓|✓|✓|| |WinBioEnrollCommit|✓|✓|✓|✓|| |WinBioEnrollDiscard|✓|✓|✓|✓|| -|WinBioEnrollSelect|✓|||✓|Experimental| +|WinBioEnrollSelect|✓|||✓|| |WinBioEnumBiometricUnits|✓|✓|✓|✓|| |WinBioEnumDatabases|✓|✓|✓|✓|| |WinBioEnumEnrollments|✓|✓|✓|✓|| @@ -48,17 +48,21 @@ Windows Biometric Framework .NET wrapper |WinBioLocateSensorWithCallback|✓|✓|✓|✓|| |WinBioLockUnit|✓|✓|✓|✓|| |WinBioLogonIdentifiedUser|✓|✓|✓|✓|| -|WinBioMonitorPresence||||✓|| +|WinBioMonitorPresence|✓|||✓|| |WinBioOpenSession|✓|✓|✓|✓|| |WinBioRegisterEventMonitor|✓|✓|✓|✓|| |WinBioReleaseFocus|✓|✓|✓|✓|| -|WinBioRemoveAllCredentials||✓|✓|✓|| -|WinBioRemoveAllDomainCredentials||✓|✓|✓|| -|WinBioRemoveCredential||✓|✓|✓|| -|WinBioSetCredential||✓|✓|✓|| -|WinBioSetProperty||||✓|| +|WinBioRemoveAllCredentials|✓|✓|✓|✓|| +|WinBioRemoveAllDomainCredentials|✓|✓|✓|✓|| +|WinBioRemoveCredential|✓|✓|✓|✓|| +|WinBioSetCredential|✓|✓|✓|✓|| +|WinBioSetProperty|✓|||✓|| |WinBioUnlockUnit|✓|✓|✓|✓|| |WinBioUnregisterEventMonitor|✓|✓|✓|✓|| |WinBioVerify|✓|✓|✓|✓|| |WinBioVerifyWithCallback|✓|✓|✓|✓|| -|WinBioWait|✓|✓|✓|✓|| \ No newline at end of file +|WinBioWait|✓|✓|✓|✓|| + +## Known Issue + +- ***AsyncOpenSession*** and ***AsyncOpenFramework*** throws Exception if specifies ***WINBIO_ASYNC_NOTIFY_CALLBACK***. \ No newline at end of file diff --git a/examples/FrameworkTester/Controls/ObservableContentControl.cs b/examples/FrameworkTester/Controls/ObservableContentControl.cs new file mode 100644 index 0000000..7ee84bd --- /dev/null +++ b/examples/FrameworkTester/Controls/ObservableContentControl.cs @@ -0,0 +1,22 @@ +using System.Windows.Controls; + +namespace FrameworkTester.Controls +{ + + public class ObservableContentControl : ContentControl + { + + protected override void OnContentChanged(object oldContent, object newContent) + { + base.OnContentChanged(oldContent, newContent); + + if (this.ContentTemplateSelector == null) + { + return; + } + this.OnContentTemplateSelectorChanged(null, this.ContentTemplateSelector); + } + + } + +} diff --git a/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumBiometricUnitsViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumBiometricUnitsViewModel.cs index b7e9777..cec45d1 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumBiometricUnitsViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumBiometricUnitsViewModel.cs @@ -9,7 +9,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioAsyncEnumBiometricUnitsViewModel : WinBioViewModel, IWinBioAsyncEnumBiometricUnitsViewModel { - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumDatabasesViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumDatabasesViewModel.cs index 28d9f62..a539392 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumDatabasesViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumDatabasesViewModel.cs @@ -20,7 +20,7 @@ public bool EnableWait set; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumServiceProvidersViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumServiceProvidersViewModel.cs index 0409616..a1f5284 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumServiceProvidersViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioAsyncEnumServiceProvidersViewModel.cs @@ -20,12 +20,12 @@ public bool EnableWait set; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } - public BiometricServiceProvider CurrentServiceProvider + public BiometricServiceProvider SelectedServiceProvider { get; set; diff --git a/examples/FrameworkTester/DesignTimes/WinBioAsyncMonitorFrameworkChangesViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioAsyncMonitorFrameworkChangesViewModel.cs index 878da97..41b049f 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioAsyncMonitorFrameworkChangesViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioAsyncMonitorFrameworkChangesViewModel.cs @@ -20,7 +20,7 @@ public bool EnableWait set; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioAsyncOpenFrameworkViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioAsyncOpenFrameworkViewModel.cs index 3914f9b..dfbe693 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioAsyncOpenFrameworkViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioAsyncOpenFrameworkViewModel.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using FrameworkTester.ViewModels.Interfaces; using GalaSoft.MvvmLight.Command; using WinBiometricDotNet; - using WINBIO_FRAMEWORK_HANDLE = System.UInt32; namespace FrameworkTester.DesignTimes @@ -44,7 +42,7 @@ public bool EnableMessageCode get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioAsyncOpenSessionViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioAsyncOpenSessionViewModel.cs index a0e0da4..c05c2e6 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioAsyncOpenSessionViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioAsyncOpenSessionViewModel.cs @@ -42,7 +42,7 @@ public bool EnableMessageCode get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioCancelViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioCancelViewModel.cs index 2eb1102..c47b01b 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioCancelViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioCancelViewModel.cs @@ -6,7 +6,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioCancelViewModel : WinBioViewModel, IWinBioCancelViewModel, IWinBioAsyncSessionViewModel { - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioCaptureSampleViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioCaptureSampleViewModel.cs index a904d06..fdd0044 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioCaptureSampleViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioCaptureSampleViewModel.cs @@ -58,7 +58,7 @@ public uint UnitId get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioCaptureSampleWithCallbackViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioCaptureSampleWithCallbackViewModel.cs index d3e4487..bd9648e 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioCaptureSampleWithCallbackViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioCaptureSampleWithCallbackViewModel.cs @@ -76,7 +76,7 @@ public uint UnitId get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioCloseFrameworkViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioCloseFrameworkViewModel.cs index bf34780..0abbdb7 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioCloseFrameworkViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioCloseFrameworkViewModel.cs @@ -6,7 +6,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioCloseFrameworkViewModel : WinBioViewModel, IWinBioCloseFrameworkViewModel { - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioCloseSessionViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioCloseSessionViewModel.cs index 9bd121b..fc48ccf 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioCloseSessionViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioCloseSessionViewModel.cs @@ -6,7 +6,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioCloseSessionViewModel : WinBioViewModel, IWinBioCloseSessionViewModel, IWinBioAsyncSessionViewModel { - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioControlUnitPrivilegedViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioControlUnitPrivilegedViewModel.cs new file mode 100644 index 0000000..ea91572 --- /dev/null +++ b/examples/FrameworkTester/DesignTimes/WinBioControlUnitPrivilegedViewModel.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using FrameworkTester.ViewModels.Interfaces; +using WinBiometricDotNet; + +namespace FrameworkTester.DesignTimes +{ + + public sealed class WinBioControlUnitPrivilegedViewModel : WinBioViewModel, IWinBioControlUnitViewModel, IWinBioAsyncSessionViewModel + { + + public IEnumerable Components + { + get; + } + + public uint ControlCode + { + get; + set; + } + + public string SendBufferFile + { + get; + set; + } + + public Component SelectedComponent + { + get; + set; + } + + public uint OperationStatus + { + get; + } + + public uint ReceiveBufferSize + { + get; + set; + } + + public uint ReceiveDataSize + { + get; + } + + public IHandleRepositoryViewModel HandleRepository + { + get; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/DesignTimes/WinBioControlUnitViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioControlUnitViewModel.cs new file mode 100644 index 0000000..e274816 --- /dev/null +++ b/examples/FrameworkTester/DesignTimes/WinBioControlUnitViewModel.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using FrameworkTester.ViewModels.Interfaces; +using WinBiometricDotNet; + +namespace FrameworkTester.DesignTimes +{ + + public sealed class WinBioControlUnitViewModel : WinBioViewModel, IWinBioControlUnitViewModel, IWinBioAsyncSessionViewModel + { + + public IEnumerable Components + { + get; + } + + public uint ControlCode + { + get; + set; + } + + public string SendBufferFile + { + get; + set; + } + + public Component SelectedComponent + { + get; + set; + } + + public uint OperationStatus + { + get; + } + + public uint ReceiveBufferSize + { + get; + set; + } + + public uint ReceiveDataSize + { + get; + } + + public IHandleRepositoryViewModel HandleRepository + { + get; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/DesignTimes/WinBioDeleteTemplateViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioDeleteTemplateViewModel.cs index 479fceb..6173d49 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioDeleteTemplateViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioDeleteTemplateViewModel.cs @@ -8,7 +8,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioDeleteTemplateViewModel : WinBioViewModel, IWinBioDeleteTemplateViewModel, IWinBioAsyncSessionViewModel { - public FingerPosition CurrentFingerPosition + public FingerPosition SelectedFingerPosition { get; set; @@ -24,7 +24,7 @@ public IBiometricIdentityRepositoryViewModel IdentityRepository get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnrollBeginViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnrollBeginViewModel.cs index d430235..1072d73 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnrollBeginViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnrollBeginViewModel.cs @@ -19,7 +19,7 @@ public IEnumerable FingerPositions get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnrollCaptureViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnrollCaptureViewModel.cs index d2d12e5..8d29c1a 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnrollCaptureViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnrollCaptureViewModel.cs @@ -12,7 +12,7 @@ public RejectDetails RejectDetail get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnrollCaptureWithCallbackViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnrollCaptureWithCallbackViewModel.cs index 56546b4..1991520 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnrollCaptureWithCallbackViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnrollCaptureWithCallbackViewModel.cs @@ -24,7 +24,7 @@ public RejectDetails RejectDetail get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnrollCommitViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnrollCommitViewModel.cs index 044ce40..2fe1cc9 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnrollCommitViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnrollCommitViewModel.cs @@ -23,7 +23,7 @@ public Guid TemplateGuid get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnrollDiscardViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnrollDiscardViewModel.cs index c19cf5b..822538e 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnrollDiscardViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnrollDiscardViewModel.cs @@ -6,7 +6,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioEnrollDiscardViewModel : WinBioViewModel, IWinBioEnrollDiscardViewModel, IWinBioAsyncSessionViewModel { - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnrollSelectViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnrollSelectViewModel.cs index d972161..4f32c64 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnrollSelectViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnrollSelectViewModel.cs @@ -6,7 +6,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioEnrollSelectViewModel : WinBioViewModel, IWinBioEnrollSelectViewModel, IWinBioAsyncSessionViewModel { - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnumDatabasesViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnumDatabasesViewModel.cs index 5ee822b..3ba02db 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnumDatabasesViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnumDatabasesViewModel.cs @@ -14,7 +14,7 @@ public RelayCommand CreateDatabaseCommand get; } - public BiometricDatabase CurrentDatabase + public BiometricDatabase SelectedDatabase { get; set; diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnumEnrollmentsViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnumEnrollmentsViewModel.cs index 54d6e8f..dab35ad 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnumEnrollmentsViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnumEnrollmentsViewModel.cs @@ -13,7 +13,7 @@ public ObservableCollection> FingerPositions get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioEnumServiceProvidersViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioEnumServiceProvidersViewModel.cs index 5384c32..ecc43e4 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioEnumServiceProvidersViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioEnumServiceProvidersViewModel.cs @@ -8,7 +8,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioEnumServiceProvidersViewModel : WinBioViewModel, IWinBioEnumServiceProvidersViewModel { - public BiometricServiceProvider CurrentServiceProvider + public BiometricServiceProvider SelectedServiceProvider { get; set; diff --git a/examples/FrameworkTester/DesignTimes/WinBioGetPropertyViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioGetPropertyViewModel.cs index ae54d3e..c4fa603 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioGetPropertyViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioGetPropertyViewModel.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; +using FrameworkTester.ViewModels; using FrameworkTester.ViewModels.Interfaces; -using WinBiometricDotNet; namespace FrameworkTester.DesignTimes { @@ -8,50 +8,23 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioGetPropertyViewModel : WinBioViewModel, IWinBioGetPropertyViewModel, IWinBioAsyncSessionViewModel { - public FingerPosition CurrentFingerPosition + public IEnumerable Properties { get; - set; - } - - public PropertyId CurrentPropertyId - { - get; - set; } - public PropertyTypes CurrentPropertyType + public PropertyViewModel SelectedProperty { get; set; } - public IEnumerable FingerPositions - { - get; - } - - public IBiometricIdentityRepositoryViewModel IdentityRepository - { - get; - } - - public byte[] PropertyBuffer - { - get; - } - - public IEnumerable PropertyTypes - { - get; - } - - public IEnumerable PropertyIds + public PropertyViewModel ResultProperty { get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioIdentifyViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioIdentifyViewModel.cs index 7dfb5be..6c99a62 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioIdentifyViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioIdentifyViewModel.cs @@ -43,7 +43,7 @@ public IdentityTypes Type get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioIdentifyWithCallbackViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioIdentifyWithCallbackViewModel.cs index 95419dd..30f8c21 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioIdentifyWithCallbackViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioIdentifyWithCallbackViewModel.cs @@ -55,7 +55,7 @@ public IdentityTypes Type get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioLocateSensorViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioLocateSensorViewModel.cs index 2e515a1..f3b8b3a 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioLocateSensorViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioLocateSensorViewModel.cs @@ -11,7 +11,7 @@ public uint UnitId get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioLocateSensorWithCallbackViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioLocateSensorWithCallbackViewModel.cs index befbbe6..494a5f4 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioLocateSensorWithCallbackViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioLocateSensorWithCallbackViewModel.cs @@ -23,7 +23,7 @@ public uint UnitId get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioLockUnitViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioLockUnitViewModel.cs index 344dc8a..fde6b06 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioLockUnitViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioLockUnitViewModel.cs @@ -6,7 +6,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioLockUnitViewModel : WinBioViewModel, IWinBioLockUnitViewModel, IWinBioAsyncSessionViewModel { - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioLogonIdentifiedUserViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioLogonIdentifiedUserViewModel.cs index 48fc9c6..07f8199 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioLogonIdentifiedUserViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioLogonIdentifiedUserViewModel.cs @@ -11,7 +11,7 @@ public bool ReturnValue get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioMonitorPresenceViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioMonitorPresenceViewModel.cs new file mode 100644 index 0000000..f7cfc68 --- /dev/null +++ b/examples/FrameworkTester/DesignTimes/WinBioMonitorPresenceViewModel.cs @@ -0,0 +1,16 @@ +using FrameworkTester.ViewModels.Interfaces; + +namespace FrameworkTester.DesignTimes +{ + + public sealed class WinBioMonitorPresenceViewModel : WinBioViewModel, IWinBioMonitorPresenceViewModel, IWinBioAsyncSessionViewModel + { + + public IHandleRepositoryViewModel HandleRepository + { + get; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/DesignTimes/WinBioOpenSessionViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioOpenSessionViewModel.cs index e1ec65b..ef57973 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioOpenSessionViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioOpenSessionViewModel.cs @@ -1,6 +1,4 @@ -using System; -using FrameworkTester.ViewModels.Interfaces; - +using FrameworkTester.ViewModels.Interfaces; using WINBIO_SESSION_HANDLE = System.UInt32; namespace FrameworkTester.DesignTimes @@ -14,7 +12,7 @@ public WINBIO_SESSION_HANDLE SessionHandle get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioRemoveAllCredentialsViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioRemoveAllCredentialsViewModel.cs new file mode 100644 index 0000000..ebbbc1d --- /dev/null +++ b/examples/FrameworkTester/DesignTimes/WinBioRemoveAllCredentialsViewModel.cs @@ -0,0 +1,10 @@ +using FrameworkTester.ViewModels.Interfaces; + +namespace FrameworkTester.DesignTimes +{ + + public sealed class WinBioRemoveAllCredentialsViewModel : WinBioViewModel, IWinBioRemoveAllCredentialsViewModel + { + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/DesignTimes/WinBioRemoveAllDomainCredentialsViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioRemoveAllDomainCredentialsViewModel.cs new file mode 100644 index 0000000..892e6b1 --- /dev/null +++ b/examples/FrameworkTester/DesignTimes/WinBioRemoveAllDomainCredentialsViewModel.cs @@ -0,0 +1,10 @@ +using FrameworkTester.ViewModels.Interfaces; + +namespace FrameworkTester.DesignTimes +{ + + public sealed class WinBioRemoveAllDomainCredentialsViewModel : WinBioViewModel, IWinBioRemoveAllDomainCredentialsViewModel + { + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/DesignTimes/WinBioRemoveCredentialViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioRemoveCredentialViewModel.cs new file mode 100644 index 0000000..4dca362 --- /dev/null +++ b/examples/FrameworkTester/DesignTimes/WinBioRemoveCredentialViewModel.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using FrameworkTester.ViewModels.Interfaces; +using WinBiometricDotNet; + +namespace FrameworkTester.DesignTimes +{ + + public sealed class WinBioRemoveCredentialViewModel : WinBioViewModel, IWinBioRemoveCredentialViewModel + { + + public IBiometricIdentityRepositoryViewModel IdentityRepository + { + get; + } + + public IEnumerable CredentialTypes + { + get; + } + + public CredentialTypes SelectedCredentialType + { + get; + set; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/DesignTimes/WinBioSetCredentialViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioSetCredentialViewModel.cs new file mode 100644 index 0000000..762fc67 --- /dev/null +++ b/examples/FrameworkTester/DesignTimes/WinBioSetCredentialViewModel.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using FrameworkTester.ViewModels.Interfaces; +using WinBiometricDotNet; + +namespace FrameworkTester.DesignTimes +{ + + public sealed class WinBioSetCredentialViewModel : WinBioViewModel, IWinBioSetCredentialViewModel, IWinBioAsyncSessionViewModel + { + + public CredentialFormat SelectedCredentialFormat + { + get; + set; + } + + public CredentialTypes SelectedCredentialType + { + get; + set; + } + + public IEnumerable CredentialFormats + { + get; + } + + public IEnumerable CredentialTypes + { + get; + } + + public IHandleRepositoryViewModel HandleRepository + { + get; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/DesignTimes/WinBioSetPropertyViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioSetPropertyViewModel.cs new file mode 100644 index 0000000..02ff596 --- /dev/null +++ b/examples/FrameworkTester/DesignTimes/WinBioSetPropertyViewModel.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using FrameworkTester.ViewModels; +using FrameworkTester.ViewModels.Interfaces; + +namespace FrameworkTester.DesignTimes +{ + + public sealed class WinBioSetPropertyViewModel : WinBioViewModel, IWinBioSetPropertyViewModel, IWinBioAsyncSessionViewModel + { + + public IEnumerable Properties + { + get; + } + + public PropertyViewModel SelectedProperty + { + get; + set; + } + + public IHandleRepositoryViewModel HandleRepository + { + get; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/DesignTimes/WinBioUnlockUnitViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioUnlockUnitViewModel.cs index 2ebb2ad..cdd8409 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioUnlockUnitViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioUnlockUnitViewModel.cs @@ -6,7 +6,7 @@ namespace FrameworkTester.DesignTimes public sealed class WinBioUnlockUnitViewModel : WinBioViewModel, IWinBioUnlockUnitViewModel, IWinBioAsyncSessionViewModel { - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioVerifyViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioVerifyViewModel.cs index f76db69..898081b 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioVerifyViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioVerifyViewModel.cs @@ -34,7 +34,7 @@ public IEnumerable FingerPositions get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioVerifyWithCallbackViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioVerifyWithCallbackViewModel.cs index ea2d2b5..4a8aca1 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioVerifyWithCallbackViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioVerifyWithCallbackViewModel.cs @@ -46,7 +46,7 @@ public IEnumerable FingerPositions get; } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/DesignTimes/WinBioViewModel.cs b/examples/FrameworkTester/DesignTimes/WinBioViewModel.cs index 8a2e1f2..dc146ae 100644 --- a/examples/FrameworkTester/DesignTimes/WinBioViewModel.cs +++ b/examples/FrameworkTester/DesignTimes/WinBioViewModel.cs @@ -8,7 +8,7 @@ namespace FrameworkTester.DesignTimes public abstract class WinBioViewModel : IWinBioViewModel { - public BiometricUnit CurrentUnit + public BiometricUnit SelectedUnit { get; set; diff --git a/examples/FrameworkTester/FrameworkTester.csproj b/examples/FrameworkTester/FrameworkTester.csproj index f04d96a..90a9055 100644 --- a/examples/FrameworkTester/FrameworkTester.csproj +++ b/examples/FrameworkTester/FrameworkTester.csproj @@ -76,6 +76,7 @@ MSBuild:Compile Designer + @@ -86,9 +87,13 @@ + + + + @@ -103,7 +108,7 @@ - + @@ -113,7 +118,13 @@ + + + + + + @@ -128,16 +139,32 @@ + + + + + + + + + + + + + + + + - + - + - + @@ -158,6 +185,8 @@ + + @@ -224,6 +253,7 @@ + @@ -263,6 +293,27 @@ WinBioAsyncOpenSession.xaml + + WinBioControlUnitPrivileged.xaml + + + WinBioSetCredential.xaml + + + WinBioSetProperty.xaml + + + WinBioRemoveAllCredentials.xaml + + + WinBioRemoveAllDomainCredentials.xaml + + + WinBioRemoveCredential.xaml + + + WinBioMonitorPresence.xaml + WinBioEnrollSelect.xaml @@ -278,6 +329,9 @@ WinBioAsyncOpenFramework.xaml + + WinBioControlUnit.xaml + WinBioGetProperty.xaml @@ -406,6 +460,34 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -426,6 +508,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/examples/FrameworkTester/Selectors/PropertyTemplateSlector.cs b/examples/FrameworkTester/Selectors/PropertyTemplateSlector.cs new file mode 100644 index 0000000..5c21139 --- /dev/null +++ b/examples/FrameworkTester/Selectors/PropertyTemplateSlector.cs @@ -0,0 +1,55 @@ +using System.Windows; +using System.Windows.Controls; +using FrameworkTester.ViewModels; + +namespace FrameworkTester.Selectors +{ + + internal sealed class PropertyTemplateSlector : DataTemplateSelector + { + + #region Properties + + public DataTemplate AntiSpoofPolicy + { + get; + set; + } + + public DataTemplate Custom + { + get; + set; + } + + public DataTemplate SampleHint + { + get; + set; + } + + #endregion + + #region Methods + + #region Overrids + + public override DataTemplate SelectTemplate(object item, DependencyObject container) + { + if (item is AntiSpoofPolicyPropertyViewModel) + return this.AntiSpoofPolicy; + if (item is CustomPropertyViewModel) + return this.Custom; + if (item is SampleHintPropertyViewModel) + return this.SampleHint; + + return null; + } + + #endregion + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/Services/Interfaces/IWinBiometricService.cs b/examples/FrameworkTester/Services/Interfaces/IWinBiometricService.cs index c46df99..6e7d1e3 100644 --- a/examples/FrameworkTester/Services/Interfaces/IWinBiometricService.cs +++ b/examples/FrameworkTester/Services/Interfaces/IWinBiometricService.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using WinBiometricDotNet; +using SIZE_T = System.IntPtr; +using ULONG = System.UInt32; namespace FrameworkTester.Services.Interfaces { @@ -20,13 +22,13 @@ public interface IWinBiometricService void AsyncMonitorFrameworkChanges(Framework framework, ChangeTypes changeType); - void AsyncOpenFramework(IntPtr userData); + void AsyncOpenFramework(SIZE_T userData); - void AsyncOpenFramework(IntPtr targetWindow, uint messageCode); + void AsyncOpenFramework(SIZE_T targetWindow, uint messageCode); - void AsyncOpenSession(IntPtr userData); + void AsyncOpenSession(SIZE_T userData); - void AsyncOpenSession(IntPtr targetWindow, uint messageCode); + void AsyncOpenSession(SIZE_T targetWindow, uint messageCode); void BeginEnroll(Session session, FingerPosition position, uint unitId); @@ -46,6 +48,24 @@ public interface IWinBiometricService BiometricIdentity CommitEnroll(Session session); + void ControlUnit(Session session, + uint unitId, + Component component, + ULONG controlCode, + byte[] sendBuffer, + byte[] receiveBuffer, + out SIZE_T receiveDataSize, + out ULONG operationStatus); + + void ControlUnitPrivileged(Session session, + uint unitId, + Component component, + ULONG controlCode, + byte[] sendBuffer, + byte[] receiveBuffer, + out SIZE_T receiveDataSize, + out ULONG operationStatus); + Guid CreateDatabase(BiometricUnit unit); void CreateDatabase(BiometricUnit unit, Guid guid); @@ -72,6 +92,14 @@ public interface IWinBiometricService void GetLogonSetting(out bool value, out SettingSourceTypes source); + AntiSpoofPolicy GetAntiSpoofPolicyProperty(Session session, + PropertyTypes propertyType, + BiometricIdentity identity); + + ULONG GetSampleHintProperty(Session session, + PropertyTypes propertyType, + uint unitId); + void GetProperty(Session session, PropertyTypes propertyType, PropertyId propertyId, @@ -92,6 +120,8 @@ void GetProperty(Session session, bool LogonIdentifiedUser(Session session); + void MonitorPresence(Session session, uint unitId); + Framework OpenFramework(IntPtr userData); Framework OpenFramework(IntPtr targetWindow, uint messageCode); @@ -106,10 +136,25 @@ void GetProperty(Session session, void ReleaseFocus(); + void RemoveAllCredentials(); + + void RemoveAllDomainCredentials(); + + void RemoveCredential(BiometricIdentity identity, CredentialTypes credentialType); + void RemoveDatabase(BiometricUnit unit, Guid databaseId); void SelectEnroll(Session session, ulong selectorValue); + void SetAntiSpoofPolicyProperty(Session session, + PropertyTypes propertyType, + BiometricIdentity identity, + AntiSpoofPolicy antiSpoofPolicy); + + void SetCredential(CredentialTypes credentialType, + byte[] credential, + CredentialFormat format); + void UnlockUnit(Session session, uint unitId); void UnregisterEventMonitor(Session session); diff --git a/examples/FrameworkTester/Services/WinBiometricService.cs b/examples/FrameworkTester/Services/WinBiometricService.cs index c71c4f3..7e56865 100644 --- a/examples/FrameworkTester/Services/WinBiometricService.cs +++ b/examples/FrameworkTester/Services/WinBiometricService.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using FrameworkTester.Services.Interfaces; using WinBiometricDotNet; +using SIZE_T = System.IntPtr; +using ULONG = System.UInt32; namespace FrameworkTester.Services { @@ -54,7 +56,7 @@ public void AsyncMonitorFrameworkChanges(Framework framework, ChangeTypes change WinBiometric.AsyncMonitorFrameworkChanges(framework, changeType); } - public void AsyncOpenFramework(IntPtr userData) + public void AsyncOpenFramework(SIZE_T userData) { WinBiometric.AsyncCompleted -= AsyncCompleted; WinBiometric.AsyncCompleted += AsyncCompleted; @@ -62,12 +64,12 @@ public void AsyncOpenFramework(IntPtr userData) WinBiometric.AsyncOpenFramework(userData); } - public void AsyncOpenFramework(IntPtr targetWindow, uint messageCode) + public void AsyncOpenFramework(SIZE_T targetWindow, uint messageCode) { WinBiometric.AsyncOpenFramework(targetWindow, messageCode); } - public void AsyncOpenSession(IntPtr userData) + public void AsyncOpenSession(SIZE_T userData) { WinBiometric.AsyncCompleted -= AsyncCompleted; WinBiometric.AsyncCompleted += AsyncCompleted; @@ -75,7 +77,7 @@ public void AsyncOpenSession(IntPtr userData) WinBiometric.AsyncOpenSession(userData); } - public void AsyncOpenSession(IntPtr targetWindow, uint messageCode) + public void AsyncOpenSession(SIZE_T targetWindow, uint messageCode) { WinBiometric.AsyncOpenSession(targetWindow, messageCode); } @@ -130,6 +132,44 @@ public BiometricIdentity CommitEnroll(Session session) { return WinBiometric.CommitEnroll(session); } + + public void ControlUnit(Session session, + uint unitId, + Component component, + ULONG controlCode, + byte[] sendBuffer, + byte[] receiveBuffer, + out SIZE_T receiveDataSize, + out ULONG operationStatus) + { + WinBiometric.ControlUnit(session, + unitId, + component, + controlCode, + sendBuffer, + receiveBuffer, + out receiveDataSize, + out operationStatus); + } + + public void ControlUnitPrivileged(Session session, + uint unitId, + Component component, + ULONG controlCode, + byte[] sendBuffer, + byte[] receiveBuffer, + out SIZE_T receiveDataSize, + out ULONG operationStatus) + { + WinBiometric.ControlUnitPrivileged(session, + unitId, + component, + controlCode, + sendBuffer, + receiveBuffer, + out receiveDataSize, + out operationStatus); + } public Guid CreateDatabase(BiometricUnit unit) { @@ -208,6 +248,20 @@ public void GetLogonSetting(out bool value, out SettingSourceTypes source) WinBiometric.GetLogonSetting(out value, out source); } + public AntiSpoofPolicy GetAntiSpoofPolicyProperty(Session session, + PropertyTypes propertyType, + BiometricIdentity identity) + { + return WinBiometric.GetAntiSpoofPolicyProperty(session, propertyType, identity); + } + + public ULONG GetSampleHintProperty(Session session, + PropertyTypes propertyType, + uint unitId) + { + return WinBiometric.GetSampleHintProperty(session, propertyType, unitId); + } + public void GetProperty(Session session, PropertyTypes propertyType, PropertyId propertyId, @@ -255,6 +309,11 @@ public bool LogonIdentifiedUser(Session session) return WinBiometric.LogonIdentifiedUser(session); } + public void MonitorPresence(Session session, uint unitId) + { + WinBiometric.MonitorPresence(session, unitId); + } + public Framework OpenFramework(IntPtr userData) { WinBiometric.AsyncCompleted -= AsyncCompleted; @@ -299,6 +358,21 @@ public void ReleaseFocus() WinBiometric.ReleaseFocus(); } + public void RemoveAllCredentials() + { + WinBiometric.RemoveAllCredentials(); + } + + public void RemoveAllDomainCredentials() + { + WinBiometric.RemoveAllDomainCredentials(); + } + + public void RemoveCredential(BiometricIdentity identity, CredentialTypes credentialType) + { + WinBiometric.RemoveCredential(identity, credentialType); + } + public void RemoveDatabase(BiometricUnit unit, Guid databaseId) { if (unit == null) @@ -312,6 +386,21 @@ public void SelectEnroll(Session session, ulong selectorValue) WinBiometric.SelectEnroll(session, selectorValue); } + public void SetAntiSpoofPolicyProperty(Session session, + PropertyTypes propertyType, + BiometricIdentity identity, + AntiSpoofPolicy antiSpoofPolicy) + { + WinBiometric.SetAntiSpoofPolicyProperty(session, propertyType, identity, antiSpoofPolicy); + } + + public void SetCredential(CredentialTypes credentialType, + byte[] credential, + CredentialFormat format) + { + WinBiometric.SetCredential(credentialType, credential, format); + } + public void UnlockUnit(Session session, uint unitId) { WinBiometric.UnlockUnit(session, unitId); diff --git a/examples/FrameworkTester/ViewModels/AntiSpoofPolicyPropertyViewModel.cs b/examples/FrameworkTester/ViewModels/AntiSpoofPolicyPropertyViewModel.cs new file mode 100644 index 0000000..5c62ccf --- /dev/null +++ b/examples/FrameworkTester/ViewModels/AntiSpoofPolicyPropertyViewModel.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels +{ + + public sealed class AntiSpoofPolicyPropertyViewModel : PropertyViewModel + { + + #region Constructors + + public AntiSpoofPolicyPropertyViewModel() + { + this.Actions = Enum.GetValues(typeof(AntiSpoofPolicyAction)).Cast().ToArray(); + this.Sources = Enum.GetValues(typeof(PolicySource)).Cast().ToArray(); + + this.SelectedAction = this.Actions.First(); + this.SelectedSource = this.Sources.First(); + } + + #endregion + + #region Properties + + public override string Name => "WINBIO_PROPERTY_ANTI_SPOOF_POLICY"; + + public IEnumerable Actions + { + get; + } + + public IEnumerable Sources + { + get; + } + + private AntiSpoofPolicyAction _SelectedAction; + + public AntiSpoofPolicyAction SelectedAction + { + get => this._SelectedAction; + set + { + this._SelectedAction = value; + this.RaisePropertyChanged(); + } + } + + private PolicySource _SelectedSource; + + public PolicySource SelectedSource + { + get => this._SelectedSource; + set + { + this._SelectedSource = value; + this.RaisePropertyChanged(); + } + } + + #endregion + + #region Methods + + public override bool CanExecute() + { + return this.IdentityRepository.SelectedIdentity != null; + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/AsyncMessagedSessionViewModel.cs b/examples/FrameworkTester/ViewModels/AsyncMessagedSessionViewModel.cs index 8a54be6..a583e45 100644 --- a/examples/FrameworkTester/ViewModels/AsyncMessagedSessionViewModel.cs +++ b/examples/FrameworkTester/ViewModels/AsyncMessagedSessionViewModel.cs @@ -1,7 +1,5 @@ using System; -using FrameworkTester.Services.Interfaces; using FrameworkTester.ViewModels.Interfaces; -using GalaSoft.MvvmLight.Ioc; using WinBiometricDotNet; namespace FrameworkTester.ViewModels diff --git a/examples/FrameworkTester/ViewModels/BiometricIdentityRepositoryViewModel.cs b/examples/FrameworkTester/ViewModels/BiometricIdentityRepositoryViewModel.cs index 0f99027..ee2b276 100644 --- a/examples/FrameworkTester/ViewModels/BiometricIdentityRepositoryViewModel.cs +++ b/examples/FrameworkTester/ViewModels/BiometricIdentityRepositoryViewModel.cs @@ -12,14 +12,14 @@ public sealed class BiometricIdentityRepositoryViewModel : ViewModelBase, IBiome #region Properties - private BiometricIdentity _CurrentBiometricIdentity; + private BiometricIdentity _SelectedIdentity; - public BiometricIdentity CurrentBiometricIdentity + public BiometricIdentity SelectedIdentity { - get => this._CurrentBiometricIdentity; + get => this._SelectedIdentity; set { - this._CurrentBiometricIdentity = value; + this._SelectedIdentity = value; this.RaisePropertyChanged(); } } @@ -48,7 +48,7 @@ public void Add(BiometricIdentity identity) this.Identities.Add(identity); } - this.CurrentBiometricIdentity = identity; + this.SelectedIdentity = identity; } #endregion diff --git a/examples/FrameworkTester/ViewModels/ChildWindowViewModel.cs b/examples/FrameworkTester/ViewModels/ChildWindowViewModel.cs index 0ff830e..a59a5f9 100644 --- a/examples/FrameworkTester/ViewModels/ChildWindowViewModel.cs +++ b/examples/FrameworkTester/ViewModels/ChildWindowViewModel.cs @@ -21,7 +21,7 @@ public abstract class ChildWindowViewModel : ViewModelBase, IChildWindowViewM private readonly IDispatcherService _DispatcherService; - private readonly IWindowRepositoryViewModel _WindowRepository; + private readonly IHandleRepositoryViewModel _HandleRepository; private HwndSource _HwndSource; @@ -34,7 +34,7 @@ public abstract class ChildWindowViewModel : ViewModelBase, IChildWindowViewM protected ChildWindowViewModel(Window window, uint messageCode) { this._DispatcherService = SimpleIoc.Default.GetInstance(); - this._WindowRepository = SimpleIoc.Default.GetInstance>(); + this._HandleRepository = SimpleIoc.Default.GetInstance>(); this._Window = window; this.MessageCode = messageCode; @@ -229,7 +229,7 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b // WM_CLOSE if (msg == 0x0010) { - this._WindowRepository.Windows.Remove(this as T); + this._HandleRepository.Handles.Remove(this as T); } else if (msg == this.MessageCode) { diff --git a/examples/FrameworkTester/ViewModels/CustomPropertyViewModel.cs b/examples/FrameworkTester/ViewModels/CustomPropertyViewModel.cs new file mode 100644 index 0000000..8117d2e --- /dev/null +++ b/examples/FrameworkTester/ViewModels/CustomPropertyViewModel.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels +{ + + public sealed class CustomPropertyViewModel : PropertyViewModel + { + + #region Constructors + + public CustomPropertyViewModel() + { + this.FingerPositions = Enum.GetValues(typeof(FingerPosition)).Cast().ToArray(); + this.PropertyIds = Enum.GetValues(typeof(PropertyId)).Cast().ToArray(); + + this.SelectedFingerPosition = this.FingerPositions.First(); + this.SelectedPropertyId = this.PropertyIds.First(); + } + + #endregion + + #region Properties + + public override string Name => "Custom"; + + private FingerPosition _SelectedFingerPosition; + + public FingerPosition SelectedFingerPosition + { + get => this._SelectedFingerPosition; + set + { + this._SelectedFingerPosition = value; + this.RaisePropertyChanged(); + } + } + + private PropertyId _SelectedPropertyId; + + public PropertyId SelectedPropertyId + { + get => this._SelectedPropertyId; + set + { + this._SelectedPropertyId = value; + this.RaisePropertyChanged(); + } + } + + public IEnumerable FingerPositions + { + get; + } + + private byte[] _PropertyBuffer; + + public byte[] PropertyBuffer + { + get => this._PropertyBuffer; + set + { + this._PropertyBuffer = value; + this.RaisePropertyChanged(); + } + } + + public IEnumerable PropertyIds + { + get; + } + + #endregion + + #region Methods + + public override bool CanExecute() + { + return this.IdentityRepository.SelectedIdentity != null; + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/FrameworkHandleRepositoryViewModel.cs b/examples/FrameworkTester/ViewModels/FrameworkHandleRepositoryViewModel.cs new file mode 100644 index 0000000..fefdc9b --- /dev/null +++ b/examples/FrameworkTester/ViewModels/FrameworkHandleRepositoryViewModel.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.ObjectModel; +using System.Linq; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight; + +namespace FrameworkTester.ViewModels +{ + + public sealed class FrameworkHandleRepositoryViewModel : ViewModelBase, IHandleRepositoryViewModel + { + + #region Properties + + private IFrameworkHandleViewModel _SelectedHandle; + + public IFrameworkHandleViewModel SelectedHandle + { + get => this._SelectedHandle; + set + { + this._SelectedHandle = value; + this.RaisePropertyChanged(); + } + } + + public ObservableCollection Handles + { + get; + } = new ObservableCollection(); + + #endregion + + #region Methods + + public void Add(IFrameworkHandleViewModel handle) + { + if (handle?.Handle == IntPtr.Zero) + return; + + if (this.Handles.Any()) + { + if (this.Handles.All(h => h != handle)) + this.Handles.Add(handle); + } + else + { + this.Handles.Add(handle); + } + + this.SelectedHandle = handle; + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/FrameworkWindowRepositoryViewModel.cs b/examples/FrameworkTester/ViewModels/FrameworkWindowRepositoryViewModel.cs deleted file mode 100644 index c839329..0000000 --- a/examples/FrameworkTester/ViewModels/FrameworkWindowRepositoryViewModel.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using FrameworkTester.ViewModels.Interfaces; -using GalaSoft.MvvmLight; - -namespace FrameworkTester.ViewModels -{ - - public sealed class FrameworkWindowRepositoryViewModel : ViewModelBase, IWindowRepositoryViewModel - { - - #region Properties - - private IFrameworkHandleViewModel _SelectedWindow; - - public IFrameworkHandleViewModel SelectedWindow - { - get => this._SelectedWindow; - set - { - this._SelectedWindow = value; - this.RaisePropertyChanged(); - } - } - - public ObservableCollection Windows - { - get; - } = new ObservableCollection(); - - #endregion - - #region Methods - - public void Add(IFrameworkHandleViewModel childWindow) - { - if (childWindow?.Handle == IntPtr.Zero) - return; - - if (this.Windows.Any()) - { - if (this.Windows.All(h => h != childWindow)) - this.Windows.Add(childWindow); - } - else - { - this.Windows.Add(childWindow); - } - - this.SelectedWindow = childWindow; - } - - #endregion - - } - -} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IAsyncOpenFrameworkChildWindowViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IAsyncOpenFrameworkChildWindowViewModel.cs index f1e1bd5..0b61b0b 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IAsyncOpenFrameworkChildWindowViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IAsyncOpenFrameworkChildWindowViewModel.cs @@ -1,5 +1,4 @@ -using System; -using WinBiometricDotNet; +using WinBiometricDotNet; namespace FrameworkTester.ViewModels.Interfaces { diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IAsyncOpenSessionChildWindowViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IAsyncOpenSessionChildWindowViewModel.cs index 11d89eb..4674151 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IAsyncOpenSessionChildWindowViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IAsyncOpenSessionChildWindowViewModel.cs @@ -1,5 +1,4 @@ -using System; -using WinBiometricDotNet; +using WinBiometricDotNet; namespace FrameworkTester.ViewModels.Interfaces { diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IBiometricIdentityRepositoryViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IBiometricIdentityRepositoryViewModel.cs index 73cffd4..c6560a1 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IBiometricIdentityRepositoryViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IBiometricIdentityRepositoryViewModel.cs @@ -10,7 +10,7 @@ public interface IBiometricIdentityRepositoryViewModel : INotifyPropertyChanged void Add(BiometricIdentity identity); - BiometricIdentity CurrentBiometricIdentity + BiometricIdentity SelectedIdentity { get; set; diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWindowRepositoryViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IHandleRepositoryViewModel.cs similarity index 57% rename from examples/FrameworkTester/ViewModels/Interfaces/IWindowRepositoryViewModel.cs rename to examples/FrameworkTester/ViewModels/Interfaces/IHandleRepositoryViewModel.cs index 843ac43..c093dce 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWindowRepositoryViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IHandleRepositoryViewModel.cs @@ -1,23 +1,22 @@ using System.Collections.ObjectModel; using System.ComponentModel; -using WinBiometricDotNet; namespace FrameworkTester.ViewModels.Interfaces { - public interface IWindowRepositoryViewModel : INotifyPropertyChanged + public interface IHandleRepositoryViewModel : INotifyPropertyChanged where T : IHandleViewModel { - void Add(T window); + void Add(T handle); - T SelectedWindow + T SelectedHandle { get; set; } - ObservableCollection Windows + ObservableCollection Handles { get; } diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IMainViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IMainViewModel.cs index 77b6cf3..478cfc9 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IMainViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IMainViewModel.cs @@ -13,13 +13,13 @@ RelayCommand ClearEventsCommand get; } - IWinBioViewModel CurrentTestTarget + IWinBioViewModel SelectedTestTarget { get; set; } - BiometricUnit CurrentUnit + BiometricUnit SelectedUnit { get; set; @@ -56,7 +56,7 @@ ObservableCollection Units get; } - IWindowRepositoryViewModel WindowRepository + IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncEnumBiometricUnitsViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncEnumBiometricUnitsViewModel.cs index bc9c1ae..bfd6d85 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncEnumBiometricUnitsViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncEnumBiometricUnitsViewModel.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; using WinBiometricDotNet; namespace FrameworkTester.ViewModels.Interfaces diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncEnumServiceProvidersViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncEnumServiceProvidersViewModel.cs index 1dd3737..7b72850 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncEnumServiceProvidersViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncEnumServiceProvidersViewModel.cs @@ -7,7 +7,7 @@ namespace FrameworkTester.ViewModels.Interfaces public interface IWinBioAsyncEnumServiceProvidersViewModel : IWinBioWithCallbackViewModel, IWinBioAsyncFrameworkViewModel, IWinBioViewModel { - BiometricServiceProvider CurrentServiceProvider + BiometricServiceProvider SelectedServiceProvider { get; set; diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncFrameworkViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncFrameworkViewModel.cs index 8e47395..4982a85 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncFrameworkViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncFrameworkViewModel.cs @@ -1,12 +1,10 @@ -using System; - -namespace FrameworkTester.ViewModels.Interfaces +namespace FrameworkTester.ViewModels.Interfaces { public interface IWinBioAsyncFrameworkViewModel { - IWindowRepositoryViewModel WindowRepository + IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncOpenSessionViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncOpenSessionViewModel.cs index 555f38d..a9abf34 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncOpenSessionViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncOpenSessionViewModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace FrameworkTester.ViewModels.Interfaces +namespace FrameworkTester.ViewModels.Interfaces { public interface IWinBioAsyncOpenSessionViewModel : IWinBioWithCallbackViewModel, IWinBioAsyncSessionViewModel, IWinBioViewModel diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncSessionViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncSessionViewModel.cs index a92d57a..af730c3 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncSessionViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioAsyncSessionViewModel.cs @@ -4,7 +4,7 @@ public interface IWinBioAsyncSessionViewModel { - IWindowRepositoryViewModel WindowRepository + IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioControlUnitPrivilegedViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioControlUnitPrivilegedViewModel.cs new file mode 100644 index 0000000..9cf3921 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioControlUnitPrivilegedViewModel.cs @@ -0,0 +1,8 @@ +namespace FrameworkTester.ViewModels.Interfaces +{ + + public interface IWinBioControlUnitPrivilegedViewModel : IWinBioControlUnitViewModel + { + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioControlUnitViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioControlUnitViewModel.cs new file mode 100644 index 0000000..7f5b243 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioControlUnitViewModel.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels.Interfaces +{ + + public interface IWinBioControlUnitViewModel : IWinBioViewModel + { + + IEnumerable Components + { + get; + } + + uint ControlCode + { + get; + set; + } + + string SendBufferFile + { + get; + set; + } + + Component SelectedComponent + { + get; + set; + } + + uint OperationStatus + { + get; + } + + uint ReceiveBufferSize + { + get; + set; + } + + uint ReceiveDataSize + { + get; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioDeleteTemplateViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioDeleteTemplateViewModel.cs index 92e991a..2d98463 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioDeleteTemplateViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioDeleteTemplateViewModel.cs @@ -7,7 +7,7 @@ namespace FrameworkTester.ViewModels.Interfaces public interface IWinBioDeleteTemplateViewModel : IWinBioViewModel { - FingerPosition CurrentFingerPosition + FingerPosition SelectedFingerPosition { get; set; diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnumDatabasesViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnumDatabasesViewModel.cs index c0dc163..25aa6c2 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnumDatabasesViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnumDatabasesViewModel.cs @@ -13,7 +13,7 @@ RelayCommand CreateDatabaseCommand get; } - BiometricDatabase CurrentDatabase + BiometricDatabase SelectedDatabase { get; set; diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnumServiceProvidersViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnumServiceProvidersViewModel.cs index 86c5188..fc6405d 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnumServiceProvidersViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnumServiceProvidersViewModel.cs @@ -7,7 +7,7 @@ namespace FrameworkTester.ViewModels.Interfaces public interface IWinBioEnumServiceProvidersViewModel : IWinBioViewModel { - BiometricServiceProvider CurrentServiceProvider + BiometricServiceProvider SelectedServiceProvider { get; set; diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioGetPropertyViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioGetPropertyViewModel.cs index 42bce82..a3771e6 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioGetPropertyViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioGetPropertyViewModel.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using WinBiometricDotNet; namespace FrameworkTester.ViewModels.Interfaces { @@ -7,45 +6,18 @@ namespace FrameworkTester.ViewModels.Interfaces public interface IWinBioGetPropertyViewModel : IWinBioViewModel { - FingerPosition CurrentFingerPosition + IEnumerable Properties { get; - set; - } - - PropertyId CurrentPropertyId - { - get; - set; } - PropertyTypes CurrentPropertyType + PropertyViewModel SelectedProperty { get; set; } - IEnumerable FingerPositions - { - get; - } - - IBiometricIdentityRepositoryViewModel IdentityRepository - { - get; - } - - byte[] PropertyBuffer - { - get; - } - - IEnumerable PropertyTypes - { - get; - } - - IEnumerable PropertyIds + PropertyViewModel ResultProperty { get; } diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioMonitorPresenceViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioMonitorPresenceViewModel.cs new file mode 100644 index 0000000..e53529b --- /dev/null +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioMonitorPresenceViewModel.cs @@ -0,0 +1,8 @@ +namespace FrameworkTester.ViewModels.Interfaces +{ + + public interface IWinBioMonitorPresenceViewModel : IWinBioViewModel + { + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveAllCredentialsViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveAllCredentialsViewModel.cs new file mode 100644 index 0000000..441af7b --- /dev/null +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveAllCredentialsViewModel.cs @@ -0,0 +1,8 @@ +namespace FrameworkTester.ViewModels.Interfaces +{ + + public interface IWinBioRemoveAllCredentialsViewModel : IWinBioViewModel + { + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveAllDomainCredentialsViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveAllDomainCredentialsViewModel.cs new file mode 100644 index 0000000..f28565b --- /dev/null +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveAllDomainCredentialsViewModel.cs @@ -0,0 +1,8 @@ +namespace FrameworkTester.ViewModels.Interfaces +{ + + public interface IWinBioRemoveAllDomainCredentialsViewModel : IWinBioViewModel + { + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveCredentialViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveCredentialViewModel.cs new file mode 100644 index 0000000..e0775e4 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioRemoveCredentialViewModel.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels.Interfaces +{ + + public interface IWinBioRemoveCredentialViewModel : IWinBioViewModel + { + + IBiometricIdentityRepositoryViewModel IdentityRepository + { + get; + } + + IEnumerable CredentialTypes + { + get; + } + + CredentialTypes SelectedCredentialType + { + get; + set; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioSetCredentialViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioSetCredentialViewModel.cs new file mode 100644 index 0000000..d5beda4 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioSetCredentialViewModel.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels.Interfaces +{ + + public interface IWinBioSetCredentialViewModel : IWinBioViewModel + { + + CredentialFormat SelectedCredentialFormat + { + get; + set; + } + + CredentialTypes SelectedCredentialType + { + get; + set; + } + + IEnumerable CredentialFormats + { + get; + } + + IEnumerable CredentialTypes + { + get; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioSetPropertyViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioSetPropertyViewModel.cs new file mode 100644 index 0000000..93f432c --- /dev/null +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioSetPropertyViewModel.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace FrameworkTester.ViewModels.Interfaces +{ + + public interface IWinBioSetPropertyViewModel : IWinBioViewModel + { + + IEnumerable Properties + { + get; + } + + PropertyViewModel SelectedProperty + { + get; + set; + } + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioViewModel.cs b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioViewModel.cs index df14fc5..a14e67c 100644 --- a/examples/FrameworkTester/ViewModels/Interfaces/IWinBioViewModel.cs +++ b/examples/FrameworkTester/ViewModels/Interfaces/IWinBioViewModel.cs @@ -7,7 +7,7 @@ namespace FrameworkTester.ViewModels.Interfaces public interface IWinBioViewModel { - BiometricUnit CurrentUnit + BiometricUnit SelectedUnit { get; set; diff --git a/examples/FrameworkTester/ViewModels/MainViewModel.cs b/examples/FrameworkTester/ViewModels/MainViewModel.cs index 41ff37a..cf64c44 100644 --- a/examples/FrameworkTester/ViewModels/MainViewModel.cs +++ b/examples/FrameworkTester/ViewModels/MainViewModel.cs @@ -19,7 +19,7 @@ public class MainViewModel : ViewModelBase, IMainViewModel #region Fields - private Session _CurrentSession; + private Session _SelectedSession; private bool _EventCancel; @@ -39,7 +39,7 @@ public MainViewModel() this._WinBiometricService = SimpleIoc.Default.GetInstance(); this._NavigationService = SimpleIoc.Default.GetInstance(); - this.WindowRepository = SimpleIoc.Default.GetInstance>(); + this.HandleRepository = SimpleIoc.Default.GetInstance>(); var winBio = typeof(IWinBioViewModel); foreach (var type in Assembly.GetExecutingAssembly() @@ -80,35 +80,35 @@ await Task.Run(() => } } - private IWinBioViewModel _CurrentTestTarget; + private IWinBioViewModel _SelectedTestTarget; - public IWinBioViewModel CurrentTestTarget + public IWinBioViewModel SelectedTestTarget { get { - return this._CurrentTestTarget; + return this._SelectedTestTarget; } set { - this._CurrentTestTarget = value; + this._SelectedTestTarget = value; this.RaisePropertyChanged(); this._NavigationService.NavigateTo(value.Name); } } - private BiometricUnit _CurrentUnit; + private BiometricUnit _SelectedUnit; - public BiometricUnit CurrentUnit + public BiometricUnit SelectedUnit { - get => this._CurrentUnit; + get => this._SelectedUnit; set { - this._CurrentUnit = value; + this._SelectedUnit = value; this.RaisePropertyChanged(); foreach (var viewModel in this.TestTargets) - viewModel.CurrentUnit = value; + viewModel.SelectedUnit = value; } } @@ -142,10 +142,10 @@ await Task.Run(() => this._DispatcherService.SafeAction(() => { if (this.TestTargets.Any()) - this.CurrentTestTarget = this.TestTargets.FirstOrDefault(); + this.SelectedTestTarget = this.TestTargets.FirstOrDefault(); if (this.Units.Any()) - this.CurrentUnit = this.Units.FirstOrDefault(); + this.SelectedUnit = this.Units.FirstOrDefault(); }); }); })); @@ -177,12 +177,12 @@ public bool ToggleMonitorEvent { if (value) { - this._CurrentSession = this.WindowRepository.SelectedWindow.Session; - this._WinBiometricService.RegisterEventMonitor(this._CurrentSession, EventTypes.Unclaimed); + this._SelectedSession = this.HandleRepository.SelectedHandle.Session; + this._WinBiometricService.RegisterEventMonitor(this._SelectedSession, EventTypes.Unclaimed); } else { - this._WinBiometricService.UnregisterEventMonitor(this._CurrentSession); + this._WinBiometricService.UnregisterEventMonitor(this._SelectedSession); } } catch (Exception e) @@ -207,7 +207,7 @@ public ObservableCollection Units get; } = new ObservableCollection(); - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/PropertyViewModel.cs b/examples/FrameworkTester/ViewModels/PropertyViewModel.cs new file mode 100644 index 0000000..a2a6749 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/PropertyViewModel.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Ioc; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels +{ + + public abstract class PropertyViewModel : ViewModelBase + { + + #region Constructors + + protected PropertyViewModel() + { + this.PropertyTypes = Enum.GetValues(typeof(PropertyTypes)).Cast().ToArray(); + + this.SelectedPropertyType = this.PropertyTypes.First(); + + this.IdentityRepository = SimpleIoc.Default.GetInstance(); + } + + #endregion + + #region Properties + + private PropertyTypes _SelectedPropertyType; + + public PropertyTypes SelectedPropertyType + { + get => this._SelectedPropertyType; + set + { + this._SelectedPropertyType = value; + this.RaisePropertyChanged(); + } + } + + public IBiometricIdentityRepositoryViewModel IdentityRepository + { + get; + } + + public abstract string Name + { + get; + } + + public IEnumerable PropertyTypes + { + get; + } + + #endregion + + #region Methods + + public virtual bool CanExecute() + { + return true; + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/SampleHintPropertyViewModel.cs b/examples/FrameworkTester/ViewModels/SampleHintPropertyViewModel.cs new file mode 100644 index 0000000..ee3d6be --- /dev/null +++ b/examples/FrameworkTester/ViewModels/SampleHintPropertyViewModel.cs @@ -0,0 +1,27 @@ +namespace FrameworkTester.ViewModels +{ + + public sealed class SampleHintPropertyViewModel : PropertyViewModel + { + + #region Properties + + public override string Name => "WINBIO_PROPERTY_SAMPLE_HINT"; + + private uint _MaximumNumberOfGoodBiometricSamples; + + public uint MaximumNumberOfGoodBiometricSamples + { + get => this._MaximumNumberOfGoodBiometricSamples; + set + { + this._MaximumNumberOfGoodBiometricSamples = value; + this.RaisePropertyChanged(); + } + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/SessionHandleRepositoryViewModel.cs b/examples/FrameworkTester/ViewModels/SessionHandleRepositoryViewModel.cs new file mode 100644 index 0000000..e8b162c --- /dev/null +++ b/examples/FrameworkTester/ViewModels/SessionHandleRepositoryViewModel.cs @@ -0,0 +1,54 @@ +using System.Collections.ObjectModel; +using System.Linq; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight; + +namespace FrameworkTester.ViewModels +{ + + public sealed class SessionHandleRepositoryViewModel : ViewModelBase, IHandleRepositoryViewModel + { + + #region Properties + + private ISessionHandleViewModel _SelectedHandle; + + public ISessionHandleViewModel SelectedHandle + { + get => this._SelectedHandle; + set + { + this._SelectedHandle = value; + this.RaisePropertyChanged(); + } + } + + public ObservableCollection Handles + { + get; + } = new ObservableCollection(); + + #endregion + + #region Methods + + public void Add(ISessionHandleViewModel handle) + { + if (this.Handles.Any()) + { + if(this.Handles.All(h => h != handle)) + this.Handles.Add(handle); + } + else + { + this.Handles.Add(handle); + } + + this.SelectedHandle = handle; + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/SessionWindowRepositoryViewModel.cs b/examples/FrameworkTester/ViewModels/SessionWindowRepositoryViewModel.cs deleted file mode 100644 index 0948a45..0000000 --- a/examples/FrameworkTester/ViewModels/SessionWindowRepositoryViewModel.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using FrameworkTester.ViewModels.Interfaces; -using GalaSoft.MvvmLight; - -namespace FrameworkTester.ViewModels -{ - - public sealed class SessionWindowRepositoryViewModel : ViewModelBase, IWindowRepositoryViewModel - { - - #region Properties - - private ISessionHandleViewModel _SelectedWindow; - - public ISessionHandleViewModel SelectedWindow - { - get => this._SelectedWindow; - set - { - this._SelectedWindow = value; - this.RaisePropertyChanged(); - } - } - - public ObservableCollection Windows - { - get; - } = new ObservableCollection(); - - #endregion - - #region Methods - - public void Add(ISessionHandleViewModel childWindow) - { - if (this.Windows.Any()) - { - if(this.Windows.All(h => h != childWindow)) - this.Windows.Add(childWindow); - } - else - { - this.Windows.Add(childWindow); - } - - this.SelectedWindow = childWindow; - } - - #endregion - - } - -} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/ViewModelLocator.cs b/examples/FrameworkTester/ViewModels/ViewModelLocator.cs index 447373f..abf7e2d 100644 --- a/examples/FrameworkTester/ViewModels/ViewModelLocator.cs +++ b/examples/FrameworkTester/ViewModels/ViewModelLocator.cs @@ -1,17 +1,3 @@ -/* - In App.xaml: - - - - - In the View: - DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}" - - You can also use Blend to do all this with the tool's support. - See http://www.galasoft.ch/mvvm -*/ - using System; using System.Linq; using System.Reflection; @@ -25,12 +11,14 @@ namespace FrameworkTester.ViewModels { + /// /// This class contains static references to all the view models in the /// application and provides an entry point for the bindings. /// public class ViewModelLocator { + /// /// Initializes a new instance of the ViewModelLocator class. /// @@ -38,22 +26,11 @@ public ViewModelLocator() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - ////if (ViewModelBase.IsInDesignModeStatic) - ////{ - //// // Create design time view services and models - //// SimpleIoc.Default.Register(); - ////} - ////else - ////{ - //// // Create run time view services and models - //// SimpleIoc.Default.Register(); - ////} - SimpleIoc.Default.Register(() => new DispatcherService(Application.Current.Dispatcher)); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); - SimpleIoc.Default.Register, SessionWindowRepositoryViewModel>(); - SimpleIoc.Default.Register, FrameworkWindowRepositoryViewModel>(); + SimpleIoc.Default.Register, SessionHandleRepositoryViewModel>(); + SimpleIoc.Default.Register, FrameworkHandleRepositoryViewModel>(); var navigationService = new FrameNavigationService(); var winBio = typeof(IWinBioViewModel); @@ -84,6 +61,8 @@ public ViewModelLocator() SimpleIoc.Default.Register(() => new WinBioCaptureSampleWithCallbackViewModel(), true); SimpleIoc.Default.Register(() => new WinBioCloseFrameworkViewModel(), true); SimpleIoc.Default.Register(() => new WinBioCloseSessionViewModel(), true); + SimpleIoc.Default.Register(() => new WinBioControlUnitViewModel(), true); + SimpleIoc.Default.Register(() => new WinBioControlUnitPrivilegedViewModel(), true); SimpleIoc.Default.Register(() => new WinBioDeleteTemplateViewModel(), true); SimpleIoc.Default.Register(() => new WinBioEnrollBeginViewModel(), true); SimpleIoc.Default.Register(() => new WinBioEnrollCaptureViewModel(), true); @@ -107,20 +86,20 @@ public ViewModelLocator() SimpleIoc.Default.Register(() => new WinBioLocateSensorWithCallbackViewModel(), true); SimpleIoc.Default.Register(() => new WinBioLockUnitViewModel(), true); SimpleIoc.Default.Register(() => new WinBioLogonIdentifiedUserViewModel(), true); + SimpleIoc.Default.Register(() => new WinBioMonitorPresenceViewModel(), true); SimpleIoc.Default.Register(() => new WinBioOpenSessionViewModel(), true); SimpleIoc.Default.Register(() => new WinBioReleaseFocusViewModel(), true); + SimpleIoc.Default.Register(() => new WinBioRemoveAllCredentialsViewModel(), true); + SimpleIoc.Default.Register(() => new WinBioRemoveAllDomainCredentialsViewModel(), true); + SimpleIoc.Default.Register(() => new WinBioRemoveCredentialViewModel(), true); + SimpleIoc.Default.Register(() => new WinBioSetCredentialViewModel(), true); + SimpleIoc.Default.Register(() => new WinBioSetPropertyViewModel(), true); SimpleIoc.Default.Register(() => new WinBioUnlockUnitViewModel(), true); SimpleIoc.Default.Register(() => new WinBioVerifyViewModel(), true); SimpleIoc.Default.Register(() => new WinBioVerifyWithCallbackViewModel(), true); } - public IMainViewModel Main - { - get - { - return ServiceLocator.Current.GetInstance(); - } - } + public IMainViewModel Main => ServiceLocator.Current.GetInstance(); public IWinBioAcquireFocusViewModel WinBioAcquireFocus => ServiceLocator.Current.GetInstance(); @@ -146,6 +125,10 @@ public IMainViewModel Main public IWinBioCloseSessionViewModel WinBioCloseSession => ServiceLocator.Current.GetInstance(); + public IWinBioControlUnitViewModel WinBioControlUnit => ServiceLocator.Current.GetInstance(); + + public IWinBioControlUnitPrivilegedViewModel WinBioControlUnitPrivileged => ServiceLocator.Current.GetInstance(); + public IWinBioDeleteTemplateViewModel WinBioDeleteTemplate => ServiceLocator.Current.GetInstance(); public IWinBioEnrollBeginViewModel WinBioEnrollBegin => ServiceLocator.Current.GetInstance(); @@ -192,19 +175,28 @@ public IMainViewModel Main public IWinBioLogonIdentifiedUserViewModel WinBioLogonIdentifiedUser => ServiceLocator.Current.GetInstance(); + public IWinBioMonitorPresenceViewModel WinBioMonitorPresence => ServiceLocator.Current.GetInstance(); + public IWinBioOpenSessionViewModel WinBioOpenSession => ServiceLocator.Current.GetInstance(); public IWinBioReleaseFocusViewModel WinBioReleaseFocus => ServiceLocator.Current.GetInstance(); + public IWinBioRemoveAllCredentialsViewModel WinBioRemoveAllCredentials => ServiceLocator.Current.GetInstance(); + + public IWinBioRemoveAllDomainCredentialsViewModel WinBioRemoveAllDomainCredentials => ServiceLocator.Current.GetInstance(); + + public IWinBioRemoveCredentialViewModel WinBioRemoveCredential => ServiceLocator.Current.GetInstance(); + + public IWinBioSetCredentialViewModel WinBioSetCredential => ServiceLocator.Current.GetInstance(); + + public IWinBioSetPropertyViewModel WinBioSetProperty => ServiceLocator.Current.GetInstance(); + public IWinBioUnlockUnitViewModel WinBioUnlockUnit => ServiceLocator.Current.GetInstance(); public IWinBioVerifyViewModel WinBioVerify => ServiceLocator.Current.GetInstance(); public IWinBioVerifyWithCallbackViewModel WinBioVerifyWithCallback => ServiceLocator.Current.GetInstance(); - public static void Cleanup() - { - // TODO Clear the ViewModels - } } + } \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioAsyncEnumBiometricUnitsViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioAsyncEnumBiometricUnitsViewModel.cs index 969696f..630ad23 100644 --- a/examples/FrameworkTester/ViewModels/WinBioAsyncEnumBiometricUnitsViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioAsyncEnumBiometricUnitsViewModel.cs @@ -19,8 +19,8 @@ public WinBioAsyncEnumBiometricUnitsViewModel() WinBiometric.AsyncCompleted -= this.WinBiometricAsyncCompleted; WinBiometric.AsyncCompleted += this.WinBiometricAsyncCompleted; - this.WindowRepository = SimpleIoc.Default.GetInstance>(); - this.WindowRepository.PropertyChanged += (sender, args) => + this.HandleRepository = SimpleIoc.Default.GetInstance>(); + this.HandleRepository.PropertyChanged += (sender, args) => { this.ExecuteCommand.RaiseCanExecuteChanged(); }; @@ -56,7 +56,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var window = this.WindowRepository.SelectedWindow; + var window = this.HandleRepository.SelectedHandle; this.BiometricService.AsyncEnumBiometricUnits(window.Framework); this.Result = "OK"; @@ -66,13 +66,13 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } public override string Name => "WinBioAsyncEnumBiometricUnits"; - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/WinBioAsyncEnumDatabasesViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioAsyncEnumDatabasesViewModel.cs index 96ff29d..231f098 100644 --- a/examples/FrameworkTester/ViewModels/WinBioAsyncEnumDatabasesViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioAsyncEnumDatabasesViewModel.cs @@ -19,8 +19,8 @@ public WinBioAsyncEnumDatabasesViewModel() WinBiometric.AsyncCompleted -= this.WinBiometricAsyncCompleted; WinBiometric.AsyncCompleted += this.WinBiometricAsyncCompleted; - this.WindowRepository = SimpleIoc.Default.GetInstance>(); - this.WindowRepository.PropertyChanged += (sender, args) => + this.HandleRepository = SimpleIoc.Default.GetInstance>(); + this.HandleRepository.PropertyChanged += (sender, args) => { this.ExecuteCommand.RaiseCanExecuteChanged(); }; @@ -56,7 +56,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var window = this.WindowRepository.SelectedWindow; + var window = this.HandleRepository.SelectedHandle; this.BiometricService.AsyncEnumDatabases(window.Framework); this.Result = "OK"; @@ -66,13 +66,13 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } public override string Name => "WinBioAsyncEnumDatabases"; - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/WinBioAsyncEnumServiceProvidersViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioAsyncEnumServiceProvidersViewModel.cs index 7fb521c..9ff1ffb 100644 --- a/examples/FrameworkTester/ViewModels/WinBioAsyncEnumServiceProvidersViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioAsyncEnumServiceProvidersViewModel.cs @@ -19,8 +19,8 @@ public WinBioAsyncEnumServiceProvidersViewModel() WinBiometric.AsyncCompleted -= this.WinBiometricAsyncCompleted; WinBiometric.AsyncCompleted += this.WinBiometricAsyncCompleted; - this.WindowRepository = SimpleIoc.Default.GetInstance>(); - this.WindowRepository.PropertyChanged += (sender, args) => + this.HandleRepository = SimpleIoc.Default.GetInstance>(); + this.HandleRepository.PropertyChanged += (sender, args) => { this.ExecuteCommand.RaiseCanExecuteChanged(); }; @@ -56,7 +56,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var window = this.WindowRepository.SelectedWindow; + var window = this.HandleRepository.SelectedHandle; this.BiometricService.AsyncEnumServiceProviders(window.Framework); this.Result = "OK"; @@ -66,25 +66,25 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } public override string Name => "WinBioAsyncEnumServiceProviders"; - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } - private BiometricServiceProvider _CurrentServiceProvider; + private BiometricServiceProvider _SelectedServiceProvider; - public BiometricServiceProvider CurrentServiceProvider + public BiometricServiceProvider SelectedServiceProvider { - get => this._CurrentServiceProvider; + get => this._SelectedServiceProvider; set { - this._CurrentServiceProvider = value; + this._SelectedServiceProvider = value; this.RaisePropertyChanged(); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioAsyncMonitorFrameworkChangesViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioAsyncMonitorFrameworkChangesViewModel.cs index 6a8eccb..3cbd485 100644 --- a/examples/FrameworkTester/ViewModels/WinBioAsyncMonitorFrameworkChangesViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioAsyncMonitorFrameworkChangesViewModel.cs @@ -23,8 +23,8 @@ public WinBioAsyncMonitorFrameworkChangesViewModel() WinBiometric.AsyncCompleted -= this.WinBiometricAsyncCompleted; WinBiometric.AsyncCompleted += this.WinBiometricAsyncCompleted; - this.WindowRepository = SimpleIoc.Default.GetInstance>(); - this.WindowRepository.PropertyChanged += (sender, args) => + this.HandleRepository = SimpleIoc.Default.GetInstance>(); + this.HandleRepository.PropertyChanged += (sender, args) => { this.ExecuteCommand.RaiseCanExecuteChanged(); }; @@ -60,8 +60,8 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var window = this.WindowRepository.SelectedWindow; - this.BiometricService.AsyncEnumBiometricUnits(window.Framework); + var window = this.HandleRepository.SelectedHandle; + this.BiometricService.AsyncMonitorFrameworkChanges(window.Framework, this.SelectedChangeType); this.Result = "OK"; } @@ -70,13 +70,13 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } public override string Name => "WinBioAsyncMonitorFrameworkChanges"; - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/WinBioAsyncOpenFrameworkViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioAsyncOpenFrameworkViewModel.cs index 67f1728..34d3827 100644 --- a/examples/FrameworkTester/ViewModels/WinBioAsyncOpenFrameworkViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioAsyncOpenFrameworkViewModel.cs @@ -7,7 +7,6 @@ using GalaSoft.MvvmLight.Command; using GalaSoft.MvvmLight.Ioc; using WinBiometricDotNet; - using WINBIO_FRAMEWORK_HANDLE = System.UInt32; namespace FrameworkTester.ViewModels @@ -30,8 +29,8 @@ public WinBioAsyncOpenFrameworkViewModel() WinBiometric.AsyncCompleted -= this.WinBiometricAsyncCompleted; WinBiometric.AsyncCompleted += this.WinBiometricAsyncCompleted; - this.WindowRepository = SimpleIoc.Default.GetInstance>(); - this.WindowRepository.PropertyChanged += (sender, args) => + this.HandleRepository = SimpleIoc.Default.GetInstance>(); + this.HandleRepository.PropertyChanged += (sender, args) => { this.ExecuteCommand.RaiseCanExecuteChanged(); }; @@ -54,7 +53,7 @@ public RelayCommand AddWindowCommand newWindow.DataContext = childWindow; newWindow.Show(); - this.WindowRepository.Add(childWindow); + this.HandleRepository.Add(childWindow); })); } } @@ -84,7 +83,7 @@ public override RelayCommand ExecuteCommand this.FrameworkHandle = this.BiometricService.OpenFramework(IntPtr.Zero).Handle; break; case AsyncNotificationMethod.NotifyMessage: - var childWindow = this.WindowRepository.SelectedWindow; + var childWindow = this.HandleRepository.SelectedHandle; var handle = childWindow.Handle; var code = childWindow.MessageCode; if (this.Async) @@ -162,7 +161,7 @@ public bool Async } } - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } @@ -237,7 +236,7 @@ private bool CanExecuteCommand() case AsyncNotificationMethod.NotifyCallback: return true; case AsyncNotificationMethod.NotifyMessage: - var childWindow = this.WindowRepository?.SelectedWindow; + var childWindow = this.HandleRepository?.SelectedHandle; return childWindow != null && childWindow.Handle != IntPtr.Zero; default: return false; diff --git a/examples/FrameworkTester/ViewModels/WinBioAsyncOpenSessionViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioAsyncOpenSessionViewModel.cs index d44697f..69afbb1 100644 --- a/examples/FrameworkTester/ViewModels/WinBioAsyncOpenSessionViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioAsyncOpenSessionViewModel.cs @@ -5,9 +5,7 @@ using FrameworkTester.ViewModels.Interfaces; using FrameworkTester.Views; using GalaSoft.MvvmLight.Command; -using GalaSoft.MvvmLight.Ioc; using WinBiometricDotNet; - using WINBIO_SESSION_HANDLE = System.UInt32; namespace FrameworkTester.ViewModels @@ -29,12 +27,6 @@ public WinBioAsyncOpenSessionViewModel() WinBiometric.AsyncCompleted -= this.WinBiometricAsyncCompleted; WinBiometric.AsyncCompleted += this.WinBiometricAsyncCompleted; - - this.WindowRepository = SimpleIoc.Default.GetInstance>(); - this.WindowRepository.PropertyChanged += (sender, args) => - { - this.ExecuteCommand.RaiseCanExecuteChanged(); - }; } #endregion @@ -54,7 +46,7 @@ public RelayCommand AddWindowCommand newWindow.DataContext = childWindow; newWindow.Show(); - this.WindowRepository.Add(childWindow); + this.HandleRepository.Add(childWindow); })); } } @@ -75,7 +67,7 @@ public override RelayCommand ExecuteCommand this.SessionHandle = 0; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; switch (this.SelectedMethod) { case AsyncNotificationMethod.NotifyCallback: @@ -85,7 +77,7 @@ public override RelayCommand ExecuteCommand this.SessionHandle = this.BiometricService.OpenSession(IntPtr.Zero).Handle; break; case AsyncNotificationMethod.NotifyMessage: - var childWindow = this.WindowRepository.SelectedWindow; + var childWindow = this.HandleRepository.SelectedHandle; var handle = childWindow.Handle; var code = childWindow.MessageCode; if (this.Async) @@ -132,7 +124,7 @@ public override RelayCommand CancelCommand { try { - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.Cancel(session); this.WaitCallback = false; @@ -209,11 +201,6 @@ public bool Async } } - public IWindowRepositoryViewModel WindowRepository - { - get; - } - private uint _MessageCode; public uint MessageCode @@ -284,7 +271,7 @@ private bool CanExecuteCommand() case AsyncNotificationMethod.NotifyCallback: return true; case AsyncNotificationMethod.NotifyMessage: - var childWindow = this.WindowRepository?.SelectedWindow; + var childWindow = this.HandleRepository?.SelectedHandle; return childWindow != null && childWindow.Handle != IntPtr.Zero; default: return false; diff --git a/examples/FrameworkTester/ViewModels/WinBioCancelViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioCancelViewModel.cs index 6692c10..e285bb7 100644 --- a/examples/FrameworkTester/ViewModels/WinBioCancelViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioCancelViewModel.cs @@ -24,7 +24,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.Cancel(session); this.Result = "OK"; @@ -34,7 +34,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioCaptureSampleViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioCaptureSampleViewModel.cs index 3c89ecd..c65dbf7 100644 --- a/examples/FrameworkTester/ViewModels/WinBioCaptureSampleViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioCaptureSampleViewModel.cs @@ -132,7 +132,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; var result = this.BiometricService.CaptureSample(session); var text = "OK"; @@ -191,7 +191,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioCaptureSampleWithCallbackViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioCaptureSampleWithCallbackViewModel.cs index b8b93b6..8a7761e 100644 --- a/examples/FrameworkTester/ViewModels/WinBioCaptureSampleWithCallbackViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioCaptureSampleWithCallbackViewModel.cs @@ -36,7 +36,7 @@ public override RelayCommand CancelCommand { try { - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.Cancel(session); this.WaitCallback = false; @@ -183,7 +183,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.CaptureSampleWithCallback(session); this.WaitCallback = true; @@ -201,7 +201,7 @@ public override RelayCommand ExecuteCommand this.WaitCallback = false; } - }, () => !this.WaitCallback && this.WindowRepository?.SelectedWindow != null)); + }, () => !this.WaitCallback && this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioCloseFrameworkViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioCloseFrameworkViewModel.cs index 3451a29..d49087c 100644 --- a/examples/FrameworkTester/ViewModels/WinBioCloseFrameworkViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioCloseFrameworkViewModel.cs @@ -18,8 +18,8 @@ public WinBioCloseFrameworkViewModel() WinBiometric.AsyncCompleted -= this.WinBiometricAsyncCompleted; WinBiometric.AsyncCompleted += this.WinBiometricAsyncCompleted; - this.WindowRepository = SimpleIoc.Default.GetInstance>(); - this.WindowRepository.PropertyChanged += (sender, args) => + this.HandleRepository = SimpleIoc.Default.GetInstance>(); + this.HandleRepository.PropertyChanged += (sender, args) => { this.ExecuteCommand.RaiseCanExecuteChanged(); }; @@ -44,7 +44,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var window = this.WindowRepository.SelectedWindow; + var window = this.HandleRepository.SelectedHandle; this.BiometricService.CloseFramework(window.Framework); this.Result = "OK"; @@ -54,13 +54,13 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } public override string Name => "WinBioCloseFramework"; - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/WinBioCloseSessionViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioCloseSessionViewModel.cs index 3d1d0fc..65fcd1d 100644 --- a/examples/FrameworkTester/ViewModels/WinBioCloseSessionViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioCloseSessionViewModel.cs @@ -24,7 +24,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.CloseSession(session); this.Result = "OK"; @@ -34,7 +34,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioControlUnitPrivilegedViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioControlUnitPrivilegedViewModel.cs new file mode 100644 index 0000000..a7ce379 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/WinBioControlUnitPrivilegedViewModel.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Windows; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight.Command; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels +{ + + public sealed class WinBioControlUnitPrivilegedViewModel : WinBioSessionViewModel, IWinBioControlUnitPrivilegedViewModel + { + + #region Constructors + + public WinBioControlUnitPrivilegedViewModel() + { + this.Components = Enum.GetValues(typeof(Component)).Cast().ToArray(); + this.SelectedComponent = this.Components.First(); + } + + #endregion + + #region Properties + + private RelayCommand _ExecuteCommand; + + public override RelayCommand ExecuteCommand + { + get + { + return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => + { + this.OperationStatus = 0; + this.ReceiveDataSize = 0; + + try + { + this.Result = "WAIT"; + this.UpdateUIImmediately(); + + var path = this.SendBufferFile; + if (!File.Exists(path)) + throw new FileNotFoundException(path); + + var sendBuffer = File.ReadAllBytes(path); + var receiveBuffer = new byte[this.ReceiveBufferSize]; + + var session = this.HandleRepository.SelectedHandle.Session; + this.BiometricService.ControlUnitPrivileged(session, + this.SelectedUnit.UnitId, + this.SelectedComponent, + this.ControlCode, + sendBuffer, + receiveBuffer, + out var receiveDataSize, + out var operationStatus); + + this.Result = "OK"; + + this.OperationStatus = operationStatus; + this.ReceiveDataSize = (uint)receiveDataSize; + } + catch (Exception e) + { + MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); + this.Result = "FAIL"; + } + }, () => this.HandleRepository?.SelectedHandle != null)); + } + } + + public override string Name => "WinBioControlUnitPrivileged"; + + public IEnumerable Components + { + get; + } + + private uint _ControlCode; + + public uint ControlCode + { + get => this._ControlCode; + set + { + this._ControlCode = value; + this.RaisePropertyChanged(); + } + } + + private string _SendBufferFile; + + public string SendBufferFile + { + get => this._SendBufferFile; + set + { + this._SendBufferFile = value; + this.RaisePropertyChanged(); + } + } + + private Component _SelectedComponent; + + public Component SelectedComponent + { + get => this._SelectedComponent; + set + { + this._SelectedComponent = value; + this.RaisePropertyChanged(); + } + } + + private uint _OperationStatus; + + public uint OperationStatus + { + get => this._OperationStatus; + private set + { + this._OperationStatus = value; + this.RaisePropertyChanged(); + } + } + + private uint _ReceiveBufferSize; + + public uint ReceiveBufferSize + { + get => this._ReceiveBufferSize; + set + { + this._ReceiveBufferSize = value; + this.RaisePropertyChanged(); + } + } + + private uint _ReceiveDataSize; + + public uint ReceiveDataSize + { + get => this._ReceiveDataSize; + private set + { + this._ReceiveDataSize = value; + this.RaisePropertyChanged(); + } + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioControlUnitViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioControlUnitViewModel.cs new file mode 100644 index 0000000..db2f911 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/WinBioControlUnitViewModel.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Windows; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight.Command; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels +{ + + public sealed class WinBioControlUnitViewModel : WinBioSessionViewModel, IWinBioControlUnitViewModel + { + + #region Constructors + + public WinBioControlUnitViewModel() + { + this.Components = Enum.GetValues(typeof(Component)).Cast().ToArray(); + this.SelectedComponent = this.Components.First(); + } + + #endregion + + #region Properties + + private RelayCommand _ExecuteCommand; + + public override RelayCommand ExecuteCommand + { + get + { + return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => + { + this.OperationStatus = 0; + this.ReceiveDataSize = 0; + + try + { + this.Result = "WAIT"; + this.UpdateUIImmediately(); + + var path = this.SendBufferFile; + if (!File.Exists(path)) + throw new FileNotFoundException(path); + + var sendBuffer = File.ReadAllBytes(path); + var receiveBuffer = new byte[this.ReceiveBufferSize]; + + var session = this.HandleRepository.SelectedHandle.Session; + this.BiometricService.ControlUnit(session, + this.SelectedUnit.UnitId, + this.SelectedComponent, + this.ControlCode, + sendBuffer, + receiveBuffer, + out var receiveDataSize, + out var operationStatus); + + this.Result = "OK"; + + this.OperationStatus = operationStatus; + this.ReceiveDataSize = (uint)receiveDataSize; + } + catch (Exception e) + { + MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); + this.Result = "FAIL"; + } + }, () => this.HandleRepository?.SelectedHandle != null)); + } + } + + public override string Name => "WinBioControlUnit"; + + public IEnumerable Components + { + get; + } + + private uint _ControlCode; + + public uint ControlCode + { + get => this._ControlCode; + set + { + this._ControlCode = value; + this.RaisePropertyChanged(); + } + } + + private string _SendBufferFile; + + public string SendBufferFile + { + get => this._SendBufferFile; + set + { + this._SendBufferFile = value; + this.RaisePropertyChanged(); + } + } + + private Component _SelectedComponent; + + public Component SelectedComponent + { + get => this._SelectedComponent; + set + { + this._SelectedComponent = value; + this.RaisePropertyChanged(); + } + } + + private uint _OperationStatus; + + public uint OperationStatus + { + get => this._OperationStatus; + private set + { + this._OperationStatus = value; + this.RaisePropertyChanged(); + } + } + + private uint _ReceiveBufferSize; + + public uint ReceiveBufferSize + { + get => this._ReceiveBufferSize; + set + { + this._ReceiveBufferSize = value; + this.RaisePropertyChanged(); + } + } + + private uint _ReceiveDataSize; + + public uint ReceiveDataSize + { + get => this._ReceiveDataSize; + private set + { + this._ReceiveDataSize = value; + this.RaisePropertyChanged(); + } + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioDeleteTemplateViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioDeleteTemplateViewModel.cs index 5d4c29d..6cd29c3 100644 --- a/examples/FrameworkTester/ViewModels/WinBioDeleteTemplateViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioDeleteTemplateViewModel.cs @@ -19,7 +19,7 @@ public WinBioDeleteTemplateViewModel() { this.FingerPositions = Enum.GetValues(typeof(FingerPosition)).Cast().ToArray(); - this.CurrentFingerPosition = this.FingerPositions.First(); + this.SelectedFingerPosition = this.FingerPositions.First(); this.IdentityRepository = SimpleIoc.Default.GetInstance(); this.IdentityRepository.PropertyChanged += (sender, args) => @@ -32,14 +32,14 @@ public WinBioDeleteTemplateViewModel() #region Properties - private FingerPosition _CurrentFingerPosition; + private FingerPosition _SelectedFingerPosition; - public FingerPosition CurrentFingerPosition + public FingerPosition SelectedFingerPosition { - get => this._CurrentFingerPosition; + get => this._SelectedFingerPosition; set { - this._CurrentFingerPosition = value; + this._SelectedFingerPosition = value; this.RaisePropertyChanged(); } } @@ -57,10 +57,10 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; - var unitId = this.CurrentUnit; - var identity = this.IdentityRepository.CurrentBiometricIdentity; - var fingerPosition = this.CurrentFingerPosition; + var session = this.HandleRepository.SelectedHandle.Session; + var unitId = this.SelectedUnit; + var identity = this.IdentityRepository.SelectedIdentity; + var fingerPosition = this.SelectedFingerPosition; this.BiometricService.DeleteTemplate(session, unitId.UnitId, @@ -74,7 +74,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.IdentityRepository?.CurrentBiometricIdentity != null && this.WindowRepository?.SelectedWindow != null)); + }, () => this.IdentityRepository?.SelectedIdentity != null && this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioEnrollBeginViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnrollBeginViewModel.cs index 88ae71c..21960ce 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnrollBeginViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnrollBeginViewModel.cs @@ -36,8 +36,8 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; - this.BiometricService.BeginEnroll(session, this.SelectedFingerPosition, this.CurrentUnit.UnitId); + var session = this.HandleRepository.SelectedHandle.Session; + this.BiometricService.BeginEnroll(session, this.SelectedFingerPosition, this.SelectedUnit.UnitId); this.Result = "OK"; } @@ -46,7 +46,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioEnrollCaptureViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnrollCaptureViewModel.cs index eb47453..9ea347c 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnrollCaptureViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnrollCaptureViewModel.cs @@ -27,7 +27,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; var result = this.BiometricService.CaptureEnroll(session); switch (result.OperationStatus) @@ -56,7 +56,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioEnrollCaptureWithCallbackViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnrollCaptureWithCallbackViewModel.cs index 4f69a31..539830f 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnrollCaptureWithCallbackViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnrollCaptureWithCallbackViewModel.cs @@ -34,7 +34,7 @@ public override RelayCommand CancelCommand { try { - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.Cancel(session); this.WaitCallback = false; @@ -65,7 +65,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.CaptureEnrollWithCallback(session); this.WaitCallback = true; @@ -83,7 +83,7 @@ public override RelayCommand ExecuteCommand this.WaitCallback = false; } - }, () => this.WaitCallback && this.WindowRepository?.SelectedWindow != null)); + }, () => this.WaitCallback && this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioEnrollCommitViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnrollCommitViewModel.cs index ec68f60..98f5a3f 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnrollCommitViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnrollCommitViewModel.cs @@ -29,7 +29,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; var result = this.BiometricService.CommitEnroll(session); this.Result = "OK"; @@ -43,7 +43,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioEnrollDiscardViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnrollDiscardViewModel.cs index 7b5cd2b..4f2ff09 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnrollDiscardViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnrollDiscardViewModel.cs @@ -24,7 +24,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.DiscardEnroll(session); this.Result = "OK"; @@ -34,7 +34,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioEnrollSelectViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnrollSelectViewModel.cs index 28f7300..8263c05 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnrollSelectViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnrollSelectViewModel.cs @@ -25,7 +25,7 @@ public override RelayCommand ExecuteCommand this.UpdateUIImmediately(); // ToDo: For fingerprint biometrics, this function always successs regardless of the selectorValue argument - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.SelectEnroll(session, 0); this.Result = "OK"; @@ -35,7 +35,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioEnumDatabasesViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnumDatabasesViewModel.cs index 6374fa3..d118908 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnumDatabasesViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnumDatabasesViewModel.cs @@ -49,7 +49,7 @@ public RelayCommand CreateDatabaseCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var guid = this.BiometricService.CreateDatabase(this.CurrentUnit); + var guid = this.BiometricService.CreateDatabase(this.SelectedUnit); this.Result = "OK"; @@ -64,17 +64,17 @@ public RelayCommand CreateDatabaseCommand } } - private BiometricDatabase _CurrentDatabase; + private BiometricDatabase _SelectedDatabase; - public BiometricDatabase CurrentDatabase + public BiometricDatabase SelectedDatabase { get { - return this._CurrentDatabase; + return this._SelectedDatabase; } set { - this._CurrentDatabase = value; + this._SelectedDatabase = value; this.RaisePropertyChanged(); } } @@ -89,14 +89,14 @@ public override RelayCommand ExecuteCommand { try { - this.CurrentDatabase = null; + this.SelectedDatabase = null; this._Databases.Clear(); foreach (var database in this.BiometricService.EnumBiometricDatabases()) this._Databases.Add(database); if (this._Databases.Any()) - this.CurrentDatabase = this._Databases.First(); + this.SelectedDatabase = this._Databases.First(); this.Result = "OK"; } @@ -131,8 +131,8 @@ public RelayCommand RemoveDatabaseCommand { try { - var databaseId = this._CurrentDatabase.DatabaseId; - this.BiometricService.RemoveDatabase(this.CurrentUnit, databaseId); + var databaseId = this._SelectedDatabase.DatabaseId; + this.BiometricService.RemoveDatabase(this.SelectedUnit, databaseId); this.Result = "OK"; var database = this._Databases.First(d => d.DatabaseId == databaseId); diff --git a/examples/FrameworkTester/ViewModels/WinBioEnumEnrollmentsViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnumEnrollmentsViewModel.cs index 3ba3eeb..cd6ffa3 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnumEnrollmentsViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnumEnrollmentsViewModel.cs @@ -30,8 +30,8 @@ public override RelayCommand ExecuteCommand this._FingerPositions.Clear(); - var session = this.WindowRepository.SelectedWindow.Session; - var positions = this.BiometricService.EnumEnrollments(session, this.CurrentUnit); + var session = this.HandleRepository.SelectedHandle.Session; + var positions = this.BiometricService.EnumEnrollments(session, this.SelectedUnit); var resuls = new List>(); foreach (var value in Enum.GetValues(typeof(FingerPosition)).Cast()) { @@ -49,7 +49,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioEnumServiceProvidersViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioEnumServiceProvidersViewModel.cs index e34ae65..54b19c2 100644 --- a/examples/FrameworkTester/ViewModels/WinBioEnumServiceProvidersViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioEnumServiceProvidersViewModel.cs @@ -14,14 +14,14 @@ public sealed class WinBioEnumServiceProvidersViewModel : WinBioViewModel, IWinB #region Properties - private BiometricServiceProvider _CurrentServiceProvider; + private BiometricServiceProvider _SelectedServiceProvider; - public BiometricServiceProvider CurrentServiceProvider + public BiometricServiceProvider SelectedServiceProvider { - get => this._CurrentServiceProvider; + get => this._SelectedServiceProvider; set { - this._CurrentServiceProvider = value; + this._SelectedServiceProvider = value; this.RaisePropertyChanged(); } } @@ -44,7 +44,7 @@ public override RelayCommand ExecuteCommand this.ServiceProviders.Add(provider); if (this.ServiceProviders.Any()) - this.CurrentServiceProvider = this.ServiceProviders.FirstOrDefault(); + this.SelectedServiceProvider = this.ServiceProviders.FirstOrDefault(); this.Result = "OK"; } diff --git a/examples/FrameworkTester/ViewModels/WinBioGetCredentialStateViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioGetCredentialStateViewModel.cs index 70251dc..18d4d21 100644 --- a/examples/FrameworkTester/ViewModels/WinBioGetCredentialStateViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioGetCredentialStateViewModel.cs @@ -41,7 +41,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var result = this.BiometricService.GetCredentialState(this.IdentityRepository.CurrentBiometricIdentity, CredentialTypes.Password); + var result = this.BiometricService.GetCredentialState(this.IdentityRepository.SelectedIdentity, CredentialTypes.Password); this.Result = "OK"; this.State = result; @@ -51,7 +51,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.IdentityRepository?.CurrentBiometricIdentity != null)); + }, () => this.IdentityRepository?.SelectedIdentity != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioGetEnrolledFactorsViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioGetEnrolledFactorsViewModel.cs index f2540d8..cf6941e 100644 --- a/examples/FrameworkTester/ViewModels/WinBioGetEnrolledFactorsViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioGetEnrolledFactorsViewModel.cs @@ -41,7 +41,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var identity = this.IdentityRepository.CurrentBiometricIdentity; + var identity = this.IdentityRepository.SelectedIdentity; var result = this.BiometricService.GetEnrolledFactors(identity); this.Result = "OK"; @@ -53,7 +53,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.IdentityRepository?.CurrentBiometricIdentity != null)); + }, () => this.IdentityRepository?.SelectedIdentity != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioGetPropertyViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioGetPropertyViewModel.cs index e1b40ea..5d4eb7f 100644 --- a/examples/FrameworkTester/ViewModels/WinBioGetPropertyViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioGetPropertyViewModel.cs @@ -5,72 +5,53 @@ using FrameworkTester.ViewModels.Interfaces; using GalaSoft.MvvmLight.Command; using GalaSoft.MvvmLight.Ioc; -using WinBiometricDotNet; namespace FrameworkTester.ViewModels { public sealed class WinBioGetPropertyViewModel : WinBioSessionViewModel, IWinBioGetPropertyViewModel { + #region Fields + + private readonly AntiSpoofPolicyPropertyViewModel _AntiSpoofPolicyPropertyResult = new AntiSpoofPolicyPropertyViewModel(); + + private readonly SampleHintPropertyViewModel _SampleHintPropertyResult = new SampleHintPropertyViewModel(); + + private readonly CustomPropertyViewModel _CustomPropertyResult = new CustomPropertyViewModel(); + + #endregion #region Constructors public WinBioGetPropertyViewModel() { - this.FingerPositions = Enum.GetValues(typeof(FingerPosition)).Cast().ToArray(); - this.PropertyTypes = Enum.GetValues(typeof(PropertyTypes)).Cast().ToArray(); - this.PropertyIds = Enum.GetValues(typeof(PropertyId)).Cast().ToArray(); + this.Properties = new PropertyViewModel[] + { + new SampleHintPropertyViewModel(), + new AntiSpoofPolicyPropertyViewModel(), + new CustomPropertyViewModel() + }; - this.CurrentFingerPosition = this.FingerPositions.First(); - this.CurrentPropertyType = this.PropertyTypes.First(); - this.CurrentPropertyId = this.PropertyIds.First(); + this.SelectedProperty = this.Properties.First(); this.IdentityRepository = SimpleIoc.Default.GetInstance(); this.IdentityRepository.PropertyChanged += (sender, args) => { this.ExecuteCommand.RaiseCanExecuteChanged(); }; - } - - #endregion - - #region Properties - - private FingerPosition _CurrentFingerPosition; - public FingerPosition CurrentFingerPosition - { - get => this._CurrentFingerPosition; - set + foreach (var property in this.Properties) { - this._CurrentFingerPosition = value; - this.RaisePropertyChanged(); - } - } - - private PropertyId _CurrentPropertyId; - - public PropertyId CurrentPropertyId - { - get => this._CurrentPropertyId; - set - { - this._CurrentPropertyId = value; - this.RaisePropertyChanged(); + property.PropertyChanged += (sender, args) => + { + this.ExecuteCommand.RaiseCanExecuteChanged(); + }; } } - private PropertyTypes _CurrentPropertyType; + #endregion - public PropertyTypes CurrentPropertyType - { - get => this._CurrentPropertyType; - set - { - this._CurrentPropertyType = value; - this.RaisePropertyChanged(); - } - } + #region Properties private RelayCommand _ExecuteCommand; @@ -80,73 +61,113 @@ public override RelayCommand ExecuteCommand { return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => { - this.PropertyBuffer = null; - try { this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; - var propertyType = this.CurrentPropertyType; - var propertyId = this.CurrentPropertyId; - var unitId = this.CurrentUnit; - var identity = this.IdentityRepository.CurrentBiometricIdentity; - var fingerPosition = this.CurrentFingerPosition; - - this.BiometricService.GetProperty(session, - propertyType, - propertyId, - unitId.UnitId, - identity, - fingerPosition, - out var propertyBuffer); + var session = this.HandleRepository.SelectedHandle.Session; + + switch (this.SelectedProperty) + { + case AntiSpoofPolicyPropertyViewModel anti: + var asp = this.BiometricService.GetAntiSpoofPolicyProperty(session, + anti.SelectedPropertyType, + anti.IdentityRepository.SelectedIdentity); + + this._AntiSpoofPolicyPropertyResult.SelectedAction = asp.Action; + this._AntiSpoofPolicyPropertyResult.SelectedSource = asp.Source; + + this.ResultProperty = this._AntiSpoofPolicyPropertyResult; + break; + case SampleHintPropertyViewModel sample: + var num = this.BiometricService.GetSampleHintProperty(session, + sample.SelectedPropertyType, + this.SelectedUnit.UnitId); + + this._SampleHintPropertyResult.MaximumNumberOfGoodBiometricSamples = num; + + this.ResultProperty = this._SampleHintPropertyResult; + break; + case CustomPropertyViewModel custom: + var propertyType = custom.SelectedPropertyType; + var propertyId = custom.SelectedPropertyId; + var unitId = this.SelectedUnit; + var identity = this.IdentityRepository.SelectedIdentity; + var fingerPosition = custom.SelectedFingerPosition; + + this.BiometricService.GetProperty(session, + propertyType, + propertyId, + unitId.UnitId, + identity, + fingerPosition, + out var propertyBuffer); + + this._CustomPropertyResult.PropertyBuffer = propertyBuffer; + + this.ResultProperty = this._CustomPropertyResult; + break; + } this.Result = "OK"; - - this.PropertyBuffer = propertyBuffer; } catch (Exception e) { MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null && this.SelectedProperty.CanExecute())); } } - public IEnumerable FingerPositions + public IBiometricIdentityRepositoryViewModel IdentityRepository { get; } - public IBiometricIdentityRepositoryViewModel IdentityRepository + public override string Name => "WinBioGetProperty"; + + public IEnumerable Properties { get; } - public override string Name => "WinBioGetProperty"; - - private byte[] _PropertyBuffer; + private PropertyViewModel _SelectedProperty; - public byte[] PropertyBuffer + public PropertyViewModel SelectedProperty { - get => this._PropertyBuffer; - private set + get => this._SelectedProperty; + set { - this._PropertyBuffer = value; + this._SelectedProperty = value; this.RaisePropertyChanged(); + + switch (this.SelectedProperty) + { + case AntiSpoofPolicyPropertyViewModel _: + this.ResultProperty = this._AntiSpoofPolicyPropertyResult; + break; + case SampleHintPropertyViewModel _: + this.ResultProperty = this._SampleHintPropertyResult; + break; + case CustomPropertyViewModel _: + this.ResultProperty = this._CustomPropertyResult; + break; + } } } - public IEnumerable PropertyIds - { - get; - } + private PropertyViewModel _ResultProperty; - public IEnumerable PropertyTypes + public PropertyViewModel ResultProperty { - get; + get => this._ResultProperty; + private set + { + this._ResultProperty = value; + this.RaisePropertyChanged(); + } } #endregion diff --git a/examples/FrameworkTester/ViewModels/WinBioIdentifyViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioIdentifyViewModel.cs index 02ef63f..568b8cf 100644 --- a/examples/FrameworkTester/ViewModels/WinBioIdentifyViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioIdentifyViewModel.cs @@ -42,7 +42,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; var result = this.BiometricService.Identify(session); this.Result = "OK"; @@ -61,7 +61,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioIdentifyWithCallbackViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioIdentifyWithCallbackViewModel.cs index 4983785..0f610fb 100644 --- a/examples/FrameworkTester/ViewModels/WinBioIdentifyWithCallbackViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioIdentifyWithCallbackViewModel.cs @@ -37,7 +37,7 @@ public override RelayCommand CancelCommand { try { - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.Cancel(session); this.WaitCallback = false; @@ -73,7 +73,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.IdentifyWithCallback(session); this.WaitCallback = true; @@ -91,7 +91,7 @@ public override RelayCommand ExecuteCommand this.WaitCallback = false; } - }, () => !this.WaitCallback && this.WindowRepository?.SelectedWindow != null)); + }, () => !this.WaitCallback && this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioLocateSensorViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioLocateSensorViewModel.cs index 4da74d9..7e8d34f 100644 --- a/examples/FrameworkTester/ViewModels/WinBioLocateSensorViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioLocateSensorViewModel.cs @@ -26,7 +26,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; var result = this.BiometricService.LocateSensor(session); this.Result = "OK"; @@ -38,7 +38,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioLocateSensorWithCallbackViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioLocateSensorWithCallbackViewModel.cs index 0471598..e4b3e6c 100644 --- a/examples/FrameworkTester/ViewModels/WinBioLocateSensorWithCallbackViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioLocateSensorWithCallbackViewModel.cs @@ -34,7 +34,7 @@ public override RelayCommand CancelCommand { try { - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.Cancel(session); this.WaitCallback = false; @@ -65,7 +65,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.LocateSensorWithCallback(session); this.WaitCallback = true; @@ -83,7 +83,7 @@ public override RelayCommand ExecuteCommand this.WaitCallback = false; } - }, () => !this.WaitCallback && this.WindowRepository?.SelectedWindow != null)); + }, () => !this.WaitCallback && this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioLockUnitViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioLockUnitViewModel.cs index a22fe4f..7b658f9 100644 --- a/examples/FrameworkTester/ViewModels/WinBioLockUnitViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioLockUnitViewModel.cs @@ -24,8 +24,8 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; - this.BiometricService.LockUnit(session, this.CurrentUnit.UnitId); + var session = this.HandleRepository.SelectedHandle.Session; + this.BiometricService.LockUnit(session, this.SelectedUnit.UnitId); this.Result = "OK"; } @@ -34,7 +34,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioLogonIdentifiedUserViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioLogonIdentifiedUserViewModel.cs index 1aadb0d..804d1b2 100644 --- a/examples/FrameworkTester/ViewModels/WinBioLogonIdentifiedUserViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioLogonIdentifiedUserViewModel.cs @@ -24,7 +24,7 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; var result = this.BiometricService.LogonIdentifiedUser(session); this.Result = "OK"; @@ -36,7 +36,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioMonitorPresenceViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioMonitorPresenceViewModel.cs new file mode 100644 index 0000000..b7cae0a --- /dev/null +++ b/examples/FrameworkTester/ViewModels/WinBioMonitorPresenceViewModel.cs @@ -0,0 +1,47 @@ +using System; +using System.Windows; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight.Command; + +namespace FrameworkTester.ViewModels +{ + + public sealed class WinBioMonitorPresenceViewModel : WinBioSessionViewModel, IWinBioMonitorPresenceViewModel + { + + #region Properties + + private RelayCommand _ExecuteCommand; + + public override RelayCommand ExecuteCommand + { + get + { + return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => + { + try + { + this.Result = "WAIT"; + this.UpdateUIImmediately(); + + var session = this.HandleRepository.SelectedHandle.Session; + this.BiometricService.MonitorPresence(session, this.SelectedUnit.UnitId); + + this.Result = "OK"; + } + catch (Exception e) + { + MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); + this.Result = "FAIL"; + } + }, () => this.HandleRepository?.SelectedHandle != null)); + } + } + + public override string Name => "WinBioMonitorPresence"; + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioOpenSessionViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioOpenSessionViewModel.cs index df6f6c0..d3c4751 100644 --- a/examples/FrameworkTester/ViewModels/WinBioOpenSessionViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioOpenSessionViewModel.cs @@ -2,7 +2,6 @@ using System.Windows; using FrameworkTester.ViewModels.Interfaces; using GalaSoft.MvvmLight.Command; - using WINBIO_SESSION_HANDLE = System.UInt32; namespace FrameworkTester.ViewModels @@ -30,7 +29,7 @@ public override RelayCommand ExecuteCommand this.Result = "OK"; - this.WindowRepository.Add(new SessionViewModel(session)); + this.HandleRepository.Add(new SessionViewModel(session)); this.SessionHandle = session.Handle; } diff --git a/examples/FrameworkTester/ViewModels/WinBioRemoveAllCredentialsViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioRemoveAllCredentialsViewModel.cs new file mode 100644 index 0000000..767b9c3 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/WinBioRemoveAllCredentialsViewModel.cs @@ -0,0 +1,46 @@ +using System; +using System.Windows; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight.Command; + +namespace FrameworkTester.ViewModels +{ + + public sealed class WinBioRemoveAllCredentialsViewModel : WinBioViewModel, IWinBioRemoveAllCredentialsViewModel + { + + #region Properties + + private RelayCommand _ExecuteCommand; + + public override RelayCommand ExecuteCommand + { + get + { + return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => + { + try + { + this.Result = "WAIT"; + this.UpdateUIImmediately(); + + this.BiometricService.RemoveAllCredentials(); + + this.Result = "OK"; + } + catch (Exception e) + { + MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); + this.Result = "FAIL"; + } + })); + } + } + + public override string Name => "WinBioRemoveAllCredentials"; + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioRemoveAllDomainCredentialsViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioRemoveAllDomainCredentialsViewModel.cs new file mode 100644 index 0000000..bfb0590 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/WinBioRemoveAllDomainCredentialsViewModel.cs @@ -0,0 +1,46 @@ +using System; +using System.Windows; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight.Command; + +namespace FrameworkTester.ViewModels +{ + + public sealed class WinBioRemoveAllDomainCredentialsViewModel : WinBioViewModel, IWinBioRemoveAllDomainCredentialsViewModel + { + + #region Properties + + private RelayCommand _ExecuteCommand; + + public override RelayCommand ExecuteCommand + { + get + { + return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => + { + try + { + this.Result = "WAIT"; + this.UpdateUIImmediately(); + + this.BiometricService.RemoveAllDomainCredentials(); + + this.Result = "OK"; + } + catch (Exception e) + { + MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); + this.Result = "FAIL"; + } + })); + } + } + + public override string Name => "WinBioRemoveAllDomainCredentials"; + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioRemoveCredentialViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioRemoveCredentialViewModel.cs new file mode 100644 index 0000000..afa34ed --- /dev/null +++ b/examples/FrameworkTester/ViewModels/WinBioRemoveCredentialViewModel.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Ioc; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels +{ + + public sealed class WinBioRemoveCredentialViewModel : WinBioViewModel, IWinBioRemoveCredentialViewModel + { + + #region Constructors + + public WinBioRemoveCredentialViewModel() + { + this.CredentialTypes = Enum.GetValues(typeof(CredentialTypes)).Cast().ToArray(); + + this.SelectedCredentialType = this.CredentialTypes.First(); + + this.IdentityRepository = SimpleIoc.Default.GetInstance(); + this.IdentityRepository.PropertyChanged += (sender, args) => + { + this.ExecuteCommand.RaiseCanExecuteChanged(); + }; + } + + #endregion + + #region Properties + + private RelayCommand _ExecuteCommand; + + public override RelayCommand ExecuteCommand + { + get + { + return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => + { + try + { + this.Result = "WAIT"; + this.UpdateUIImmediately(); + + var identity = this.IdentityRepository.SelectedIdentity; + var credentialType = this.SelectedCredentialType; + + this.BiometricService.RemoveCredential(identity, credentialType); + + this.Result = "OK"; + } + catch (Exception e) + { + MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); + this.Result = "FAIL"; + } + }, () => this.IdentityRepository?.SelectedIdentity != null)); + } + } + + public override string Name => "WinBioRemoveCredential"; + + public IBiometricIdentityRepositoryViewModel IdentityRepository + { + get; + } + + public IEnumerable CredentialTypes + { + get; + } + + private CredentialTypes _SelectedCredentialType; + + public CredentialTypes SelectedCredentialType + { + get => this._SelectedCredentialType; + set + { + this._SelectedCredentialType = value; + this.RaisePropertyChanged(); + } + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioSessionViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioSessionViewModel.cs index b561bdb..d661ca4 100644 --- a/examples/FrameworkTester/ViewModels/WinBioSessionViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioSessionViewModel.cs @@ -11,14 +11,14 @@ public abstract class WinBioSessionViewModel : WinBioViewModel, IWinBioAsyncSess protected WinBioSessionViewModel() { - this.WindowRepository = SimpleIoc.Default.GetInstance>(); + this.HandleRepository = SimpleIoc.Default.GetInstance>(); } #endregion #region Properties - public IWindowRepositoryViewModel WindowRepository + public IHandleRepositoryViewModel HandleRepository { get; } diff --git a/examples/FrameworkTester/ViewModels/WinBioSetCredentialViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioSetCredentialViewModel.cs new file mode 100644 index 0000000..710c8a4 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/WinBioSetCredentialViewModel.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight.Command; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels +{ + + public sealed class WinBioSetCredentialViewModel : WinBioViewModel, IWinBioSetCredentialViewModel + { + + #region Constructors + + public WinBioSetCredentialViewModel() + { + this.CredentialTypes = Enum.GetValues(typeof(CredentialTypes)).Cast().ToArray(); + this.CredentialFormats = Enum.GetValues(typeof(CredentialFormat)).Cast().ToArray(); + + this.SelectedCredentialType = this.CredentialTypes.First(); + this.SelectedCredentialFormat = this.CredentialFormats.First(); + } + + #endregion + + #region Properties + + private RelayCommand _ExecuteCommand; + + public override RelayCommand ExecuteCommand + { + get + { + return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => + { + try + { + this.Result = "WAIT"; + this.UpdateUIImmediately(); + + var type = this.SelectedCredentialType; + var format = this.SelectedCredentialFormat; + // ToDo: Handles with care for this function + // Therefore, it should fail for now + var credential = new byte[0]; + this.BiometricService.SetCredential(type, + credential, + format); + + this.Result = "OK"; + } + catch (Exception e) + { + MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); + this.Result = "FAIL"; + } + })); + } + } + + public override string Name => "WinBioSetCredential"; + + private CredentialFormat _SelectedCredentialFormat; + + public CredentialFormat SelectedCredentialFormat + { + get => this._SelectedCredentialFormat; + set + { + this._SelectedCredentialFormat = value; + this.RaisePropertyChanged(); + } + } + + private CredentialTypes _SelectedCredentialType; + + public CredentialTypes SelectedCredentialType + { + get => this._SelectedCredentialType; + set + { + this._SelectedCredentialType = value; + this.RaisePropertyChanged(); + } + } + + public IEnumerable CredentialFormats + { + get; + } + + public IEnumerable CredentialTypes + { + get; + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioSetPropertyViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioSetPropertyViewModel.cs new file mode 100644 index 0000000..662cf22 --- /dev/null +++ b/examples/FrameworkTester/ViewModels/WinBioSetPropertyViewModel.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using FrameworkTester.ViewModels.Interfaces; +using GalaSoft.MvvmLight.Command; +using WinBiometricDotNet; + +namespace FrameworkTester.ViewModels +{ + + public sealed class WinBioSetPropertyViewModel : WinBioSessionViewModel, IWinBioSetPropertyViewModel + { + + #region Constructors + + public WinBioSetPropertyViewModel() + { + this.Properties = new PropertyViewModel[] { new AntiSpoofPolicyPropertyViewModel() }; + + this.SelectedProperty = this.Properties.First(); + + foreach (var property in this.Properties) + { + property.PropertyChanged += (sender, args) => + { + this.ExecuteCommand.RaiseCanExecuteChanged(); + }; + } + } + + #endregion + + #region Properties + + private RelayCommand _ExecuteCommand; + + public override RelayCommand ExecuteCommand + { + get + { + return this._ExecuteCommand ?? (this._ExecuteCommand = new RelayCommand(() => + { + try + { + this.Result = "WAIT"; + this.UpdateUIImmediately(); + + var session = this.HandleRepository.SelectedHandle.Session; + + switch (this.SelectedProperty) + { + case AntiSpoofPolicyPropertyViewModel anti: + var asp = new AntiSpoofPolicy + { + Action = anti.SelectedAction, + Source = anti.SelectedSource + }; + + this.BiometricService.SetAntiSpoofPolicyProperty(session, + anti.SelectedPropertyType, + anti.IdentityRepository.SelectedIdentity, + asp); + break; + case CustomPropertyViewModel _: + break; + } + + this.Result = "OK"; + } + catch (Exception e) + { + MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); + this.Result = "FAIL"; + } + }, () => this.HandleRepository?.SelectedHandle != null && this.SelectedProperty.CanExecute())); + } + } + + public override string Name => "WinBioSetProperty"; + + public IEnumerable Properties + { + get; + } + + private PropertyViewModel _SelectedProperty; + + public PropertyViewModel SelectedProperty + { + get => this._SelectedProperty; + set + { + this._SelectedProperty = value; + this.RaisePropertyChanged(); + } + } + + #endregion + + } + +} \ No newline at end of file diff --git a/examples/FrameworkTester/ViewModels/WinBioUnlockUnitViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioUnlockUnitViewModel.cs index 38af9a0..82c9c95 100644 --- a/examples/FrameworkTester/ViewModels/WinBioUnlockUnitViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioUnlockUnitViewModel.cs @@ -24,8 +24,8 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; - this.BiometricService.UnlockUnit(session, this.CurrentUnit.UnitId); + var session = this.HandleRepository.SelectedHandle.Session; + this.BiometricService.UnlockUnit(session, this.SelectedUnit.UnitId); this.Result = "OK"; } @@ -34,7 +34,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioVerifyViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioVerifyViewModel.cs index 459f61f..f619a65 100644 --- a/examples/FrameworkTester/ViewModels/WinBioVerifyViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioVerifyViewModel.cs @@ -40,8 +40,8 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; - var result = this.BiometricService.Verify(session, this.CurrentUnit, this.SelectedFingerPosition); + var session = this.HandleRepository.SelectedHandle.Session; + var result = this.BiometricService.Verify(session, this.SelectedUnit, this.SelectedFingerPosition); this.Result = "OK"; @@ -54,7 +54,7 @@ public override RelayCommand ExecuteCommand MessageBox.Show(e.Message, this.Name, MessageBoxButton.OK, MessageBoxImage.Error); this.Result = "FAIL"; } - }, () => this.WindowRepository?.SelectedWindow != null)); + }, () => this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioVerifyWithCallbackViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioVerifyWithCallbackViewModel.cs index e5b34f3..2b6756c 100644 --- a/examples/FrameworkTester/ViewModels/WinBioVerifyWithCallbackViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioVerifyWithCallbackViewModel.cs @@ -38,7 +38,7 @@ public override RelayCommand CancelCommand { try { - var session = this.WindowRepository.SelectedWindow.Session; + var session = this.HandleRepository.SelectedHandle.Session; this.BiometricService.Cancel(session); this.WaitCallback = false; @@ -71,8 +71,8 @@ public override RelayCommand ExecuteCommand this.Result = "WAIT"; this.UpdateUIImmediately(); - var session = this.WindowRepository.SelectedWindow.Session; - this.BiometricService.VerifyWithCallback(session, this.CurrentUnit, this.SelectedFingerPosition); + var session = this.HandleRepository.SelectedHandle.Session; + this.BiometricService.VerifyWithCallback(session, this.SelectedUnit, this.SelectedFingerPosition); this.WaitCallback = true; @@ -89,7 +89,7 @@ public override RelayCommand ExecuteCommand this.WaitCallback = false; } - }, () => this.WaitCallback && this.WindowRepository?.SelectedWindow != null)); + }, () => this.WaitCallback && this.HandleRepository?.SelectedHandle != null)); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioViewModel.cs index be5e823..cf9047e 100644 --- a/examples/FrameworkTester/ViewModels/WinBioViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioViewModel.cs @@ -24,17 +24,17 @@ protected WinBioViewModel() #region Properties - private BiometricUnit _CurrentUnit; + private BiometricUnit _SelectedUnit; - public BiometricUnit CurrentUnit + public BiometricUnit SelectedUnit { get { - return this._CurrentUnit; + return this._SelectedUnit; } set { - this._CurrentUnit = value; + this._SelectedUnit = value; this.RaisePropertyChanged(); } } diff --git a/examples/FrameworkTester/ViewModels/WinBioWithCallbackViewModel.cs b/examples/FrameworkTester/ViewModels/WinBioWithCallbackViewModel.cs index 9986270..aa174db 100644 --- a/examples/FrameworkTester/ViewModels/WinBioWithCallbackViewModel.cs +++ b/examples/FrameworkTester/ViewModels/WinBioWithCallbackViewModel.cs @@ -1,7 +1,5 @@ -using FrameworkTester.Services.Interfaces; -using FrameworkTester.ViewModels.Interfaces; +using FrameworkTester.ViewModels.Interfaces; using GalaSoft.MvvmLight.Command; -using GalaSoft.MvvmLight.Ioc; namespace FrameworkTester.ViewModels { diff --git a/examples/FrameworkTester/Views/ChildWindow.xaml.cs b/examples/FrameworkTester/Views/ChildWindow.xaml.cs index 6e4a61e..11d90cb 100644 --- a/examples/FrameworkTester/Views/ChildWindow.xaml.cs +++ b/examples/FrameworkTester/Views/ChildWindow.xaml.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; +using System.Windows; namespace FrameworkTester.Views { diff --git a/examples/FrameworkTester/Views/MainWindow.xaml b/examples/FrameworkTester/Views/MainWindow.xaml index 86c8f6f..ee68073 100644 --- a/examples/FrameworkTester/Views/MainWindow.xaml +++ b/examples/FrameworkTester/Views/MainWindow.xaml @@ -47,7 +47,7 @@ Grid.Column="2" VerticalAlignment="Center" ItemsSource="{Binding TestTargets}" - SelectedItem="{Binding CurrentTestTarget}"> + SelectedItem="{Binding SelectedTestTarget}"> @@ -66,7 +66,7 @@ Grid.Column="2" VerticalAlignment="Center" ItemsSource="{Binding Units}" - SelectedItem="{Binding CurrentUnit}"> + SelectedItem="{Binding SelectedUnit}"> @@ -123,8 +123,8 @@ + ItemsSource="{Binding HandleRepository.Handles}" + SelectedItem="{Binding HandleRepository.SelectedHandle}" /> diff --git a/examples/FrameworkTester/Views/WinBioAsyncEnumBiometricUnits.xaml b/examples/FrameworkTester/Views/WinBioAsyncEnumBiometricUnits.xaml index a147308..dda0609 100644 --- a/examples/FrameworkTester/Views/WinBioAsyncEnumBiometricUnits.xaml +++ b/examples/FrameworkTester/Views/WinBioAsyncEnumBiometricUnits.xaml @@ -51,8 +51,8 @@ + ItemsSource="{Binding HandleRepository.Handles}" + SelectedItem="{Binding HandleRepository.SelectedHandle}"> diff --git a/examples/FrameworkTester/Views/WinBioAsyncEnumDatabases.xaml b/examples/FrameworkTester/Views/WinBioAsyncEnumDatabases.xaml index 7298a19..a94e3e0 100644 --- a/examples/FrameworkTester/Views/WinBioAsyncEnumDatabases.xaml +++ b/examples/FrameworkTester/Views/WinBioAsyncEnumDatabases.xaml @@ -51,8 +51,8 @@ + ItemsSource="{Binding HandleRepository.Handles}" + SelectedItem="{Binding HandleRepository.SelectedHandle}"> diff --git a/examples/FrameworkTester/Views/WinBioAsyncEnumServiceProviders.xaml b/examples/FrameworkTester/Views/WinBioAsyncEnumServiceProviders.xaml index 4ddb80c..de72842 100644 --- a/examples/FrameworkTester/Views/WinBioAsyncEnumServiceProviders.xaml +++ b/examples/FrameworkTester/Views/WinBioAsyncEnumServiceProviders.xaml @@ -51,8 +51,8 @@ + ItemsSource="{Binding HandleRepository.Handles}" + SelectedItem="{Binding HandleRepository.SelectedHandle}"> diff --git a/examples/FrameworkTester/Views/WinBioAsyncMonitorFrameworkChanges.xaml b/examples/FrameworkTester/Views/WinBioAsyncMonitorFrameworkChanges.xaml index b71c7c4..9504560 100644 --- a/examples/FrameworkTester/Views/WinBioAsyncMonitorFrameworkChanges.xaml +++ b/examples/FrameworkTester/Views/WinBioAsyncMonitorFrameworkChanges.xaml @@ -64,8 +64,8 @@ + ItemsSource="{Binding HandleRepository.Handles}" + SelectedItem="{Binding HandleRepository.SelectedHandle}"> diff --git a/examples/FrameworkTester/Views/WinBioAsyncOpenFramework.xaml b/examples/FrameworkTester/Views/WinBioAsyncOpenFramework.xaml index 65a2919..c60611c 100644 --- a/examples/FrameworkTester/Views/WinBioAsyncOpenFramework.xaml +++ b/examples/FrameworkTester/Views/WinBioAsyncOpenFramework.xaml @@ -80,8 +80,8 @@ + ItemsSource="{Binding HandleRepository.Handles}" + SelectedItem="{Binding HandleRepository.SelectedHandle}"> diff --git a/examples/FrameworkTester/Views/WinBioAsyncOpenSession.xaml b/examples/FrameworkTester/Views/WinBioAsyncOpenSession.xaml index 9e74814..147cb41 100644 --- a/examples/FrameworkTester/Views/WinBioAsyncOpenSession.xaml +++ b/examples/FrameworkTester/Views/WinBioAsyncOpenSession.xaml @@ -81,8 +81,8 @@ + ItemsSource="{Binding HandleRepository.Handles}" + SelectedItem="{Binding HandleRepository.SelectedHandle}" /> + ItemsSource="{Binding HandleRepository.Handles}" + SelectedItem="{Binding HandleRepository.SelectedHandle}" />