Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit f6b9cceb authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

adding component certification number to verify component screen

parent 77767d11
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ namespace HashingTool.ViewModel ...@@ -13,6 +13,7 @@ namespace HashingTool.ViewModel
{ {
public class VerifyComponentInputDataViewModel : HashedXMLFile, IMainView, INotifyPropertyChanged public class VerifyComponentInputDataViewModel : HashedXMLFile, IMainView, INotifyPropertyChanged
{ {
private string _certificationNumber;
//private bool _componentDataValid; //private bool _componentDataValid;
public VerifyComponentInputDataViewModel() public VerifyComponentInputDataViewModel()
...@@ -26,6 +27,17 @@ namespace HashingTool.ViewModel ...@@ -26,6 +27,17 @@ namespace HashingTool.ViewModel
get { return ApplicationViewModel.HomeView; } get { return ApplicationViewModel.HomeView; }
} }
public string CertificationNumber
{
get { return _certificationNumber; }
private set {
if (_certificationNumber == value)
return;
_certificationNumber = value;
RaisePropertyChanged("CertificationNumber");
}
}
private void ComponentFilechanged(object sender, PropertyChangedEventArgs e) private void ComponentFilechanged(object sender, PropertyChangedEventArgs e)
{ {
if (e.PropertyName == GeneralUpdate) { if (e.PropertyName == GeneralUpdate) {
...@@ -47,6 +59,7 @@ namespace HashingTool.ViewModel ...@@ -47,6 +59,7 @@ namespace HashingTool.ViewModel
throw new InvalidDataException(); throw new InvalidDataException();
} }
Component = h.GetContainigComponents().First().XMLElementName(); Component = h.GetContainigComponents().First().XMLElementName();
CertificationNumber = h.GetCertificationNumber(h.GetContainigComponents().First(), 0);
} catch (Exception e) { } catch (Exception e) {
Component = ""; Component = "";
_xmlFile.LogError(e.Message); _xmlFile.LogError(e.Message);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
xmlns:views="clr-namespace:HashingTool.Views" xmlns:views="clr-namespace:HashingTool.Views"
xmlns:helper="clr-namespace:HashingTool.Helper" xmlns:helper="clr-namespace:HashingTool.Helper"
x:Class="HashingTool.Views.VerifyComponentInputData" x:Class="HashingTool.Views.VerifyComponentInputData"
mc:Ignorable="d" d:DesignWidth="534" d:DesignHeight="290"> mc:Ignorable="d" d:DesignWidth="604" d:DesignHeight="462">
<UserControl.Resources> <UserControl.Resources>
<helper:CollectionConverter x:Key="CollectionConverter" /> <helper:CollectionConverter x:Key="CollectionConverter" />
</UserControl.Resources> </UserControl.Resources>
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" MinWidth="100" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
...@@ -67,24 +69,28 @@ ...@@ -67,24 +69,28 @@
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Certification Date:" /> <Label Grid.Row="0" Grid.Column="0" Content="Certification Number:" Margin="0"/>
<TextBox Grid.Row="0" Grid.Column="1" Text="{helper:CultureAwareBinding Path=Date, StringFormat='g'}" Margin="10,2" IsReadOnly="True" /> <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding CertificationNumber, Mode=OneWay}"
Margin="10,2" IsReadOnly="True" />
<Label Grid.Row="0" Grid.Column="2" Content="Date:" />
<TextBox Grid.Row="0" Grid.Column="3" Text="{helper:CultureAwareBinding Path=Date, StringFormat='g'}" Margin="10,2" IsReadOnly="True" />
<Label Grid.Row="1" Grid.Column="0" Content="Component:" /> <Label Grid.Row="1" Grid.Column="0" Content="Component:" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Component}" Margin="10,2" IsReadOnly="True" /> <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Component}" Margin="10,2" IsReadOnly="True" />
<Label Grid.Row="2" Grid.Column="0" Content="Canonicalization methods:" /> <Label Grid.Row="2" Grid.Column="0" Content="Canonicalization methods:" />
<TextBox Grid.Row="2" Grid.Column="1" <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
Text="{Binding CanonicalizationMethods, Mode=OneWay, Converter={StaticResource CollectionConverter}}" Text="{Binding CanonicalizationMethods, Mode=OneWay, Converter={StaticResource CollectionConverter}}"
Margin="10,2" IsReadOnly="True" /> Margin="10,2" IsReadOnly="True" />
<Label Grid.Row="3" Grid.Column="0" Content="Digest method:" /> <Label Grid.Row="3" Grid.Column="0" Content="Digest method:" />
<TextBox Grid.Row="3" Grid.Column="1" <TextBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3"
Text="{Binding DigestMethod ,Mode=OneWay}" Text="{Binding DigestMethod ,Mode=OneWay}"
Margin="10,2" IsReadOnly="True" /> Margin="10,2" IsReadOnly="True" />
<Label Grid.Row="4" Grid.Column="0" Content="Digest Value read:" Style="{StaticResource DigestValueLabelStyle}" /> <Label Grid.Row="4" Grid.Column="0" Content="Digest Value read:" Style="{StaticResource DigestValueLabelStyle}" />
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding DigestValueRead}" Margin="10,2" IsReadOnly="True"> <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding DigestValueRead}" Margin="10,2" IsReadOnly="True">
<TextBox.Style> <TextBox.Style>
<Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}">
<Style.Triggers> <Style.Triggers>
...@@ -101,7 +107,7 @@ ...@@ -101,7 +107,7 @@
<Label Grid.Row="5" Grid.Column="0" Content="Digest Value computed:" <Label Grid.Row="5" Grid.Column="0" Content="Digest Value computed:"
Style="{StaticResource DigestValueLabelStyle}" /> Style="{StaticResource DigestValueLabelStyle}" />
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding DigestValueComputed}" Margin="10,2" IsReadOnly="True"> <TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding DigestValueComputed}" Margin="10,2" IsReadOnly="True">
<TextBox.Style> <TextBox.Style>
<Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}"> <Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}">
<Style.Triggers> <Style.Triggers>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment