-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements ISLOG SAM Manager Template as a new read-only Key Store
Add new option on Key Store to inform about Key Entries Update capability (default set to true)
- Loading branch information
Showing
22 changed files
with
608 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...nager.Library.KeyStore.NXP_SAM.UI/ISLOG/Domain/ISLOGKeyStorePropertiesControlViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using CommunityToolkit.Mvvm.Input; | ||
using Leosac.KeyManager.Library.KeyStore.NXP_SAM.ISLOG; | ||
using Leosac.KeyManager.Library.Plugin.UI.Domain; | ||
using Microsoft.Win32; | ||
|
||
namespace Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.ISLOG.Domain | ||
{ | ||
public class ISLOGKeyStorePropertiesControlViewModel : KeyStorePropertiesControlViewModel | ||
{ | ||
public ISLOGKeyStorePropertiesControlViewModel() | ||
{ | ||
_properties = new ISLOGKeyStoreProperties(); | ||
BrowseCommand = new RelayCommand(() => | ||
{ | ||
var ofd = new OpenFileDialog(); | ||
ofd.Filter = "Xml files (*.xml)|*.xml"; | ||
ofd.FileName = ISLOGProperties!.TemplateFile; | ||
ofd.CheckPathExists = true; | ||
if (ofd.ShowDialog() == true) | ||
{ | ||
ISLOGProperties.TemplateFile = ofd.FileName; | ||
} | ||
}); | ||
} | ||
|
||
public ISLOGKeyStoreProperties? ISLOGProperties | ||
{ | ||
get { return Properties as ISLOGKeyStoreProperties; } | ||
} | ||
|
||
public RelayCommand BrowseCommand { get; } | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
KeyManager.Library.KeyStore.NXP_SAM.UI/ISLOG/ISLOGKeyStorePropertiesControl.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<UserControl x:Class="Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.ISLOG.ISLOGKeyStorePropertiesControl" | ||
xmlns="http:https://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http:https://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http:https://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http:https://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:domain="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.ISLOG.Domain" | ||
xmlns:kslibDomain="clr-namespace:Leosac.KeyManager.Library.UI.Domain;assembly=KeyManager.Library.UI" | ||
xmlns:libui="clr-namespace:Leosac.KeyManager.Library.UI;assembly=KeyManager.Library.UI" | ||
xmlns:local="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.ISLOG" | ||
xmlns:materialDesign="http:https://materialdesigninxaml.net/winfx/xaml/themes" | ||
xmlns:properties="clr-namespace:Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.Properties" | ||
xmlns:wpfappctrls="clr-namespace:Leosac.WpfApp.Controls;assembly=WpfApp" | ||
mc:Ignorable="d" | ||
d:DataContext="{d:DesignInstance domain:ISLOGKeyStorePropertiesControlViewModel}" | ||
d:DesignHeight="200" d:DesignWidth="500"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="150" /> | ||
</Grid.ColumnDefinitions> | ||
<TextBox Grid.Row="0" Grid.Column="0" x:Name="tbxTemplateFile" HorizontalAlignment="Left" Margin="5,5,5,5" TextWrapping="Wrap" VerticalAlignment="Top" Width="300" IsReadOnly="True" | ||
materialDesign:HintAssist.HelperText="{x:Static properties:Resources.ISLOGTemplateFileHelper}" | ||
materialDesign:HintAssist.Hint="{x:Static properties:Resources.ISLOGTemplateFile}" | ||
Style="{StaticResource MaterialDesignFloatingHintTextBox}"> | ||
<TextBox.Text> | ||
<Binding Path="ISLOGProperties.TemplateFile"> | ||
<Binding.ValidationRules> | ||
<kslibDomain:NotEmptyValidationRule /> | ||
</Binding.ValidationRules> | ||
</Binding> | ||
</TextBox.Text> | ||
</TextBox> | ||
<Button Grid.Row="0" Grid.Column="1" x:Name="btnBrowse" Content="{x:Static properties:Resources.Browse}" HorizontalAlignment="Left" Margin="5,5,5,5" VerticalAlignment="Top" Command="{Binding BrowseCommand}"/> | ||
</Grid> | ||
</UserControl> |
15 changes: 15 additions & 0 deletions
15
KeyManager.Library.KeyStore.NXP_SAM.UI/ISLOG/ISLOGKeyStorePropertiesControl.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Windows.Controls; | ||
|
||
namespace Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.ISLOG | ||
{ | ||
/// <summary> | ||
/// Interaction logic for ISLOGKeyStorePropertiesControl.xaml | ||
/// </summary> | ||
public partial class ISLOGKeyStorePropertiesControl : UserControl | ||
{ | ||
public ISLOGKeyStorePropertiesControl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
KeyManager.Library.KeyStore.NXP_SAM.UI/ISLOG/ISLOGKeyStoreUIFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Leosac.KeyManager.Library.KeyStore.NXP_SAM.ISLOG; | ||
using Leosac.KeyManager.Library.KeyStore.NXP_SAM.UI.ISLOG.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.ISLOG | ||
{ | ||
public class ISLOGKeyStoreUIFactory : KeyStoreUIFactory | ||
{ | ||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()?.DeclaringType); | ||
|
||
public ISLOGKeyStoreUIFactory() | ||
{ | ||
targetFactory = new ISLOGKeyStoreFactory(); | ||
} | ||
|
||
public override string Name => "ISLOG SAM Manager Template"; | ||
|
||
public override Type GetPropertiesType() | ||
{ | ||
return typeof(ISLOGKeyStoreProperties); | ||
} | ||
|
||
public override UserControl CreateKeyStorePropertiesControl() | ||
{ | ||
return new ISLOGKeyStorePropertiesControl(); | ||
} | ||
|
||
public override KeyStorePropertiesControlViewModel? CreateKeyStorePropertiesControlViewModel() | ||
{ | ||
try | ||
{ | ||
return new ISLOGKeyStorePropertiesControlViewModel(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
log.Error("Error when initializing the key store view model", ex); | ||
return null; | ||
} | ||
} | ||
|
||
public override IDictionary<string, UserControl> CreateKeyStoreAdditionalControls() | ||
{ | ||
return new Dictionary<string, UserControl>(); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
KeyManager.Library.KeyStore.NXP_SAM.UI/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.