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

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

working on results view

parent 58cf7f4a
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,9 @@
<Compile Include="Views\HomeView.xaml.cs">
<DependentUpon>HomeView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Test.xaml.cs">
<DependentUpon>Test.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserControl\VectoXMLFileSelector.xaml.cs">
<DependentUpon>VectoXMLFileSelector.xaml</DependentUpon>
</Compile>
......@@ -100,6 +103,9 @@
<Compile Include="Views\VerifyJobInputData.xaml.cs">
<DependentUpon>VerifyJobInputData.xaml</DependentUpon>
</Compile>
<Compile Include="Views\VerifyResults.xaml.cs">
<DependentUpon>VerifyResults.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......@@ -140,6 +146,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Test.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserControl\VectoXMLFileSelector.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......@@ -156,6 +166,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\VerifyResults.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
......
......@@ -21,6 +21,9 @@
<DataTemplate DataType="{x:Type viewModel:VerifyJobInputDataViewModel}">
<views:VerifyJobInputData />
</DataTemplate>
<DataTemplate DataType="{x:Type viewModel:VerifyResultDataViewModel}">
<views:VerifyResults />
</DataTemplate>
</Window.Resources>
<Grid Margin="10">
......
......@@ -23,6 +23,7 @@ namespace HashingTool.ViewModel
new HashComponentDataViewModel(this),
new VerifyComponentInputDataViewModel(this),
new VerifyJobInputDataViewModel(this),
new VerifyResultDataViewModel(this),
};
CurrentViewModel = homeView;
......
......@@ -24,7 +24,7 @@ namespace HashingTool.ViewModel
_jobFile.PropertyChanged += JobFilechanged;
// TODO!
CanonicalizaitionMethods = new ObservableCollection<string>() {
CanonicalizationMethods = new ObservableCollection<string>() {
"urn:vecto:xml:2017:canonicalization",
"http://www.w3.org/2001/10/xml-exc-c14n#"
};
......@@ -54,7 +54,7 @@ namespace HashingTool.ViewModel
public ObservableCollection<ComponentEntry> Components { get; private set; }
public ObservableCollection<string> CanonicalizaitionMethods { get; private set; }
public ObservableCollection<string> CanonicalizationMethods { get; private set; }
public string DigestValueComputed
{
......
using System.Windows.Input;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Input;
using HashingTool.Helper;
using HashingTool.ViewModel.UserControl;
namespace HashingTool.ViewModel
......@@ -6,31 +10,32 @@ namespace HashingTool.ViewModel
public class VerifyResultDataViewModel : ObservableObject, IMainView
{
private ApplicationViewModel _applicationViewModel;
private XMLFile _jobFile;
private XMLFile _manufacturerReport;
private XMLFile _customerReport;
private string _jobDigestValue;
private string _manufacturerDigestComputed;
private string _manufacturerDigestRead;
private string _customerDigestComputed;
private string _customerDigestRead;
private bool? _manufacturerReportValid;
private bool? _customerReportValid;
private string _manufacturerReportJobDigest;
private string _customerReportJobDigest;
private bool _manufacturerReportJobDigestValid;
private bool _customerReportJobDigestValid;
public VerifyResultDataViewModel() {}
private HashedXMLFile _jobFile;
private HashedXMLFile _customerReport;
private HashedXMLFile _manufacturerReport;
public VerifyResultDataViewModel()
{
_jobFile = new HashedXMLFile(_ioService, "Job File");
_manufacturerReport = new HashedXMLFile(_ioService, "Manufacturer Report");
_customerReport = new HashedXMLFile(_ioService, "Customer Report");
Files = new ObservableCollection<HashedXMLFile>();
Files.Add(_jobFile);
Files.Add(_manufacturerReport);
Files.Add(_customerReport);
CanonicalizationMethods = new ObservableCollection<string>() { "urn:vecto:xml:2017:canonicalization" };
RaisePropertyChanged("CanonicalizationMethods");
}
public VerifyResultDataViewModel(ApplicationViewModel applicationViewModel) : this()
{
_applicationViewModel = applicationViewModel;
_jobFile = new XMLFile(_ioService, true);
_manufacturerReport = new XMLFile(_ioService, true);
_customerReport = new XMLFile(_ioService, true);
}
public ObservableCollection<string> CanonicalizationMethods { get; private set; }
public string Name
{
get { return "Verify Result Data"; }
......@@ -41,151 +46,105 @@ namespace HashingTool.ViewModel
get { return ApplicationViewModel.HomeView; }
}
public XMLFile JobFile
public HashedXMLFile JobFile
{
get { return _jobFile; }
}
public XMLFile ManufacturerReport
{
get { return _manufacturerReport; }
}
public XMLFile CustomerReport
public HashedXMLFile CustomerReport
{
get { return _customerReport; }
}
public string JobDigestValueComputed
public HashedXMLFile ManufacturerReport
{
get { return _jobDigestValue; }
private set {
if (_jobDigestValue == value) {
return;
}
_jobDigestValue = value;
RaisePropertyChanged("JobDigestValueComputed");
}
get { return _manufacturerReport; }
}
public string ManufacturerReportDigestValueComputed
{
get { return _manufacturerDigestComputed; }
private set {
if (_manufacturerDigestComputed == value) {
return;
}
_manufacturerDigestComputed = value;
RaisePropertyChanged("ManufacturerReportDigestValueComputed");
}
}
public ObservableCollection<HashedXMLFile> Files { get; private set; }
public string ManufacturerReportDigestValueRead
{
get { return _manufacturerDigestRead; }
private set {
if (_manufacturerDigestRead == value) {
return;
}
_manufacturerDigestRead = value;
RaisePropertyChanged("ManufacturerReportDigestValueRead");
}
}
public bool? ManufacturerReportValid
public class HashedXMLFile : ObservableObject
{
get { return _manufacturerReportValid; }
private set {
if (_manufacturerReportValid == value) {
return;
}
_manufacturerReportValid = value;
RaisePropertyChanged("ManufacturerReportValid");
}
}
private XMLFile _xmlFile;
public string CustomerReportDigestValueComputed
{
get { return _customerDigestComputed; }
private set {
if (_customerDigestComputed == value) {
return;
}
_customerDigestComputed = value;
RaisePropertyChanged("CustomerReportDigestValueComputed");
}
}
private string _manufacturerDigestComputed;
private string _manufacturerDigestRead;
private bool? _valid;
private string _name;
public string CustomerReportDigestValueRead
{
get { return _customerDigestRead; }
private set {
if (_customerDigestRead == value) {
return;
}
_customerDigestRead = value;
RaisePropertyChanged("CustomerReportDigestValueRead");
public HashedXMLFile(IOService ioService, string name)
{
_ioService = ioService;
_xmlFile = new XMLFile(_ioService, true);
Name = name;
CanonicalizationMethods = new[] {
"urn:vecto:xml:2017:canonicalization",
"http://www.w3.org/2001/10/xml-exc-c14n#"
};
Valid = true;
}
}
public bool? CustomerReportValid
{
get { return _customerReportValid; }
private set {
if (_customerReportValid == value) {
return;
}
_customerReportValid = value;
RaisePropertyChanged("CustomerReportValid");
public HashedXMLFile() {}
public XMLFile XMLFile
{
get { return _xmlFile; }
}
}
public string ManufacturerReportJobDigestValue
{
get { return _manufacturerReportJobDigest; }
private set {
if (_manufacturerReportJobDigest == value) {
return;
public string Name
{
get { return _name; }
private set {
if (_name == value) {
return;
}
_name = value;
RaisePropertyChanged("Name");
}
_manufacturerReportJobDigest = value;
RaisePropertyChanged("ManufacturerReportJobDigestValue");
}
}
public string CustomerReportJobDigestValue
{
get { return _customerReportJobDigest; }
private set {
if (_customerReportJobDigest == value) {
return;
public string[] CanonicalizationMethods { get; private set; }
public string DigestValueComputed
{
get { return _manufacturerDigestComputed; }
private set {
if (_manufacturerDigestComputed == value) {
return;
}
_manufacturerDigestComputed = value;
RaisePropertyChanged("DigestValueComputed");
}
_customerReportJobDigest = value;
RaisePropertyChanged("CustomerReportJobDigestValue");
}
}
public bool ManufacturerReportJobDigestValid
{
get { return _manufacturerReportJobDigestValid; }
private set {
if (_manufacturerReportJobDigestValid == value) {
return;
public string DigestValueRead
{
get { return _manufacturerDigestRead; }
private set {
if (_manufacturerDigestRead == value) {
return;
}
_manufacturerDigestRead = value;
RaisePropertyChanged("DigestValueRead");
}
_manufacturerReportJobDigestValid = value;
RaisePropertyChanged("ManufacturerReportJobDigestValid");
}
}
public bool CustomerReportJobDigestValid
{
get { return _customerReportJobDigestValid; }
private set {
if (_customerReportJobDigestValid == value) {
return;
public bool? Valid
{
get { return _valid; }
private set {
if (_valid == value) {
return;
}
_valid = value;
RaisePropertyChanged("Valid");
}
_customerReportJobDigestValid = value;
RaisePropertyChanged("CustomerReportJobDigestValid");
}
}
}
......
......@@ -22,12 +22,15 @@
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="ContentTemplate" Value="{StaticResource ICON_XML_unknown}" />
<Setter Property="ToolTip" Value="Not validated" />
<Style.Triggers>
<DataTrigger Binding="{Binding XMLFile.IsValid}" Value="True">
<Setter Property="ContentTemplate" Value="{StaticResource Icon_XML_OK}" />
<Setter Property="ToolTip" Value="Valid XML" />
</DataTrigger>
<DataTrigger Binding="{Binding XMLFile.IsValid}" Value="False">
<Setter Property="ContentTemplate" Value="{StaticResource Icon_XML_NOK}" />
<Setter Property="ToolTip" Value="Invalid XML" />
</DataTrigger>
</Style.Triggers>
</Style>
......@@ -37,10 +40,11 @@
<StackPanel Orientation="Horizontal" Margin="10,44,0,10">
<StackPanel.Style>
<Style TargetType="StackPanel">
<Setter Property="Visibility" Value="{Binding XMLFile.ValidateInput, Converter={StaticResource BoolToVis}}"/>
<Setter Property="Visibility" Value="{Binding XMLFile.ValidateInput, Converter={StaticResource BoolToVis}}" />
</Style>
</StackPanel.Style>
<Label Content="{Binding XMLFile.XMLValidationErrors.Count}" ContentStringFormat="{}{0} Warnings/Errors" MinWidth="80">
<Label Content="{Binding XMLFile.XMLValidationErrors.Count}" ContentStringFormat="{}{0} Warnings/Errors"
MinWidth="80">
<Label.Style>
<Style TargetType="Label">
<Setter Property="Foreground" Value="Red" />
......@@ -52,7 +56,8 @@
</Style>
</Label.Style>
</Label>
<Button x:Name="btnDetails" Margin="10,0,0,0" Content="Details..." HorizontalAlignment="Left" Width="91" Click="btnDetails_Click">
<Button x:Name="btnDetails" Margin="10,0,0,0" Content="Details..." HorizontalAlignment="Left" Width="91"
Click="btnDetails_Click">
<Button.Style>
<Style TargetType="Button">
<Setter Property="IsEnabled" Value="True" />
......
......@@ -35,7 +35,7 @@
</Grid.RowDefinitions>
<Grid Grid.Row="1" Margin="0,5">
<Label Content="Canonicalization methods:" />
<TextBox Text="{Binding CanonicalizaitionMethods , Converter={StaticResource CollectionConverter}}"
<TextBox Text="{Binding CanonicalizationMethods , Converter={StaticResource CollectionConverter}}"
Margin="155,0,10,0" IsReadOnly="True" />
</Grid>
<Grid Grid.Row="2" Margin="0,5">
......
This diff is collapsed.
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.Navigation;
using System.Windows.Shapes;
using HashingTool.ViewModel.UserControl;
namespace HashingTool.Views
{
/// <summary>
/// Interaction logic for VerifyResults.xaml
/// </summary>
///
public partial class VerifyResults : UserControl
{
public VerifyResults()
{
InitializeComponent();
}
}
}
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