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
{
public class VerifyComponentInputDataViewModel : HashedXMLFile, IMainView, INotifyPropertyChanged
{
private string _certificationNumber;
//private bool _componentDataValid;
public VerifyComponentInputDataViewModel()
......@@ -26,6 +27,17 @@ namespace HashingTool.ViewModel
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)
{
if (e.PropertyName == GeneralUpdate) {
......@@ -47,6 +59,7 @@ namespace HashingTool.ViewModel
throw new InvalidDataException();
}
Component = h.GetContainigComponents().First().XMLElementName();
CertificationNumber = h.GetCertificationNumber(h.GetContainigComponents().First(), 0);
} catch (Exception e) {
Component = "";
_xmlFile.LogError(e.Message);
......
......@@ -7,7 +7,7 @@
xmlns:views="clr-namespace:HashingTool.Views"
xmlns:helper="clr-namespace:HashingTool.Helper"
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>
<helper:CollectionConverter x:Key="CollectionConverter" />
</UserControl.Resources>
......@@ -56,6 +56,8 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" MinWidth="100" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
......@@ -67,24 +69,28 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Certification Date:" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{helper:CultureAwareBinding Path=Date, StringFormat='g'}" Margin="10,2" IsReadOnly="True" />
<Label Grid.Row="0" Grid.Column="0" Content="Certification Number:" Margin="0"/>
<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:" />
<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:" />
<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}}"
Margin="10,2" IsReadOnly="True" />
<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}"
Margin="10,2" IsReadOnly="True" />
<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>
<Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}">
<Style.Triggers>
......@@ -101,7 +107,7 @@
<Label Grid.Row="5" Grid.Column="0" Content="Digest Value computed:"
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>
<Style TargetType="TextBox" BasedOn="{StaticResource DigestValueTextboxStyle}">
<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