-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
SAMKeyStoreUIFactory.cs
52 lines (45 loc) · 1.64 KB
/
SAMKeyStoreUIFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Domain;
using Leosac.KeyManager.Library.Plugin;
using Leosac.KeyManager.Library.Plugin.UI.Domain;
using System.Windows.Controls;
namespace Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI
{
public class SAMKeyStoreUIFactory : KeyStoreUIFactory
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()?.DeclaringType);
public SAMKeyStoreUIFactory()
{
targetFactory = new SAMKeyStoreFactory();
}
public override string Name => "NXP SAM AV2/AV3";
public override Type GetPropertiesType()
{
return typeof(SAMKeyStoreProperties);
}
public override UserControl CreateKeyStorePropertiesControl()
{
return new SAMKeyStorePropertiesControl();
}
public override KeyStorePropertiesControlViewModel? CreateKeyStorePropertiesControlViewModel()
{
try
{
return new SAMKeyStorePropertiesControlViewModel();
}
catch (Exception ex)
{
log.Error("Error when initializing the key store view model", ex);
return null;
}
}
public override IDictionary<string, UserControl> CreateKeyStoreAdditionalControls()
{
var controls = new Dictionary<string, UserControl>
{
{ "Key Usage Counters", new SAMKeyStoreKeyCounterControl() },
{ "Tools", new SAMKeyStoreToolsControl() }
};
return controls;
}
}
}