-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
84 lines (67 loc) · 7.14 KB
/
MainWindow.xaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<Window x:Class="PdfAuthorVerifier.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PdfAuthorVerifier"
mc:Ignorable="d"
Title="Analyze Pdf files (PDF Author Verifier) // Вася (+371 29 47 91 90)" Width="1280" Height="800" MinWidth="650" MinHeight="350" WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style x:Key="DataGridCellWithDate" TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding AdHock_Item1}" Value="True">
<Setter Property="Background" Value="Yellow"/>
</DataTrigger>
<DataTrigger Binding="{Binding AdHock_Item2}" Value="True">
<Setter Property="Background" Value="LightBlue"/>
</DataTrigger>
<DataTrigger Binding="{Binding AdHock_Item3}" Value="True">
<Setter Property="Background" Value="Red"/>
</DataTrigger>
<DataTrigger Binding="{Binding AdHock_Item4}" Value="True">
<Setter Property="Background" Value="LightGreen"/>
</DataTrigger>
<DataTrigger Binding="{Binding AdHock_Item5}" Value="True">
<Setter Property="Background" Value="DarkRed"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="DataGridCellWithAuthor" TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding AdHock_Item6}" Value="True">
<Setter Property="Background" Value="GreenYellow"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Label Style="{StaticResource ResourceKey=LabelRegular}" Content="Root folders:" ToolTip="One per line" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/>
<TextBox VerticalScrollBarVisibility="Visible" Height="81" Margin="110,10,10,0" TextWrapping="Wrap" AcceptsReturn="True" Text="{Binding Path=RootFolder, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=IsEnabled_RootFolder}" VerticalAlignment="Top" MaxLines="255"/>
<Button Content="Scan folder and subfolders for PDF files" HorizontalAlignment="Left" Margin="10,96,0,0" VerticalAlignment="Top" Width="250" IsEnabled="{Binding Path=IsEnabled_SearchForFilesCommand}" Command="{Binding Path=SearchForFilesCommand}" />
<Button Content="Clear" Command="{Binding Path=ClearListOfFilesCommand}" IsEnabled="{Binding Path=IsEnabled_ClearCommand}" HorizontalAlignment="Left" Margin="265,96,0,0" VerticalAlignment="Top" Width="100"/>
<Button Content="Analyze files" Command="{Binding Path=AnalyzeFilesCommand}" IsEnabled="{Binding Path=IsEnabled_AnalyzeFilesCommand}" HorizontalAlignment="Left" Margin="370,96,0,0" VerticalAlignment="Top" Width="100"/>
<Button Content="Export to CSV" Command="{Binding Path=ExportResultCommand}" IsEnabled="{Binding Path=IsEnabled_ExportResultCommand}" HorizontalAlignment="Left" Margin="475,96,0,0" VerticalAlignment="Top" Width="100"/>
<ProgressBar Value="{Binding Path=ProgressPosition}" Maximum="{Binding Path=ProgressMax}" Height="10" Margin="10,123,10,0" VerticalAlignment="Top"/>
<Label Content="{Binding Path=ProgressStatus}" Margin="10,138,10,0" VerticalAlignment="Top" Height="9"/>
<DataGrid x:Name="dgMain" Style="{StaticResource ResourceKey=DataGridMain}" ItemsSource="{Binding Path=Items}" Margin="10,166,10,40">
<DataGrid.Columns>
<DataGridTextColumn Header="File name" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmed}" Binding="{Binding Path=FileName}" MinWidth="75" Width="7*"/>
<DataGridTextColumn Header="Title" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmed}" HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" Binding="{Binding Path=Title}" MinWidth="75" Width="4*"/>
<DataGridTextColumn Header="Author" CellStyle="{StaticResource ResourceKey=DataGridCellWithAuthor}" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmed}" HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" Binding="{Binding Path=Author}" MinWidth="75" Width="3*"/>
<DataGridTextColumn Header="Producer" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmed}" HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" Binding="{Binding Path=Producer}" MinWidth="75" Width="2*"/>
<DataGridTextColumn Header="Publisher" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmed}" HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" Binding="{Binding Path=Publisher}" MinWidth="75" Width="2*"/>
<DataGridTextColumn Header="Created" CellStyle="{StaticResource ResourceKey=DataGridCellWithDate}" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmedCentered}" HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" Binding="{Binding Path=CreationDate, StringFormat={StaticResource ResourceKey=DateFormat}}" MinWidth="75" Width="2*"/>
<DataGridTextColumn Header="Changed" CellStyle="{StaticResource ResourceKey=DataGridCellWithDate}" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmedCentered}" HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" Binding="{Binding Path=ModificationDate, StringFormat={StaticResource ResourceKey=DateFormat}}" MinWidth="75" Width="2*"/>
<DataGridTextColumn Header="Pages" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmedCentered}" HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" Binding="{Binding Path=NumberOfPages}" MinWidth="75" Width="1*"/>
<DataGridTextColumn Header="File length in bytes"
HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" HeaderTemplate="{StaticResource ResourceKey=HeaderStyleCenteredTwoLine}"
Binding="{Binding Path=FileLength}" MinWidth="75" Width="1*">
</DataGridTextColumn>
<DataGridCheckBoxColumn Header="Encrypted" HeaderTemplate="{StaticResource ResourceKey=HeaderStyleCenteredRotated}" Binding="{Binding Path=Encrypted}" MinWidth="25" Width="25" MaxWidth="25"/>
<DataGridTextColumn Header="Status" ElementStyle="{StaticResource ResourceKey=TextBlockTrimmedCentered}" HeaderStyle="{StaticResource ResourceKey=HeaderStyleCentered}" Binding="{Binding Path=DisplayValue_Status}" MinWidth="75" Width="1*"/>
</DataGrid.Columns>
</DataGrid>
<TextBox Margin="10,0,90,10" TextWrapping="Wrap" Text="{Binding Path=SearchQuery, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="23" VerticalAlignment="Bottom"/>
<Button Content="Search" Margin="0,0,10,10" Command="{Binding Path=RunSearchCommand}" HorizontalAlignment="Right" Width="75" VerticalAlignment="Bottom"/>
</Grid>
</Window>