My favorites
▼
|
Sign in
yasbe
Yet Another Simple Backup Enabler
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
App
/
MainWindow.xaml
‹r15
r18
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<Window x:Class="YASBE.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:global="clr-namespace:;assembly="
xmlns:local="clr-namespace:YASBE"
xmlns:SysIO="clr-namespace:System.IO;assembly=mscorlib"
Title="YASBE - Yet Another Simple Backup Enabler" WindowState="Maximized"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
xmlns:Properties="clr-namespace:YASBE.Properties"
xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
xmlns:conv="clr-namespace:WPFValueConverters"
>
<Window.CommandBindings>
<!--CommandBinding Command="{x:Static local:RoutedCommands.CopyToExclusions}" Executed="CopyToExclusions_Executed" /-->
</Window.CommandBindings>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="5*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GridSplitter Grid.Column="1" Grid.Row="1" ResizeDirection="Columns" Width="10" ResizeBehavior="PreviousAndNext" VerticalAlignment="Stretch" />
<Border Background="LightSteelBlue" Padding="10" Grid.Row="0" Grid.ColumnSpan="3" >
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" >
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Button Content="Save Profile Parameters" Click="BackupProfileSave_Click" />
<Label FontSize="24" Content="Current Backup Profile:" />
<ComboBox Name="cbxBackupProfiles" SelectionChanged="cbxBackupProfiles_SelectionChanged"
DisplayMemberPath="Name"
SelectedValuePath="BackupProfileID"
SelectedValue="{Binding Mode=TwoWay, Source={x:Static Properties:Settings.Default}, Path=SelectedBackupProfileID}" />
<Button Content="Refresh" Click="RefreshProfile_Click" />
<Label Content="Media Size:" />
<ComboBox Name="cbxMediaSize" DisplayMemberPath="Name" SelectedValuePath="MediaSizeID" diagnostics:PresentationTraceSources.TraceLevel="High"
SelectedValue="{Binding Mode=TwoWay, ElementName=cbxBackupProfiles, Path=SelectedItem[MediaSizeID]}" />
<Button Content="Edit Size" Click="EditMediaSize_Click" />
</StackPanel>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<TextBlock Text="Windows Burn Staging Folder:" />
<ComboBox Name="cbxBurnFolders" ItemsSource="{Binding Mode=OneTime, Source={x:Static local:MainWindow.WindowsBurnStagingFolders}}" SelectedIndex="0" />
<Button Content="Open In Explorer..." Click="OpenStagingFolder_Click" />
<!--Button.Style>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}"> <nugget: basing a Style off the Default Style>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=cbxBurnFolders, Path=SelectedIndex}" Value="-1"> <nugget: Button.IsEnabled based on ComboBox.SelectedIndex >
<Setter Property="Button.IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button-->
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="0 0 5 0">
<TextBlock Text="Favorite Staging Folders:" />
<ListBox Name="lbxFavoriteBurnFolders" MinWidth="50" DisplayMemberPath="Path" SelectedValuePath="Path" />
</StackPanel>
<Button Content="Assign Favorite to Selected Staging Folder" Click="AssignFavoriteToSelectedBurnStagingFolder_Click" />
<Button Content="Add New Favorite..." Click="AddNewFavoriteTempBurnFolder_Click" />
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
<Grid Grid.Row="1" Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Incremental Backup History" >
<DockPanel>
<DockPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Margin" Value="3 3 0 0" />
</Style>
</DockPanel.Resources>
<WrapPanel DockPanel.Dock="Top" Background="LightSteelBlue">
<Button Content="New Incremental Backup" Click="NewIncremental_Click" Margin="10" />
<Label Content="Active Incremental #:" FontSize="14" FontWeight="Bold" />
<TextBlock DataContext="{Binding Mode=OneWay, Path=ActiveIncrementalRow}"
Visibility="{Binding Mode=OneWay, Converter={conv:NotNullToVisibleConverter}}"> <!-- blank path passes DataContext object to converter -->
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} - {1:MMM dd, yyyy}" >
<Binding Mode="OneWay" Path="[IncrementalID]" />
<Binding Mode="OneWay" Path="[BackupDate]" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</WrapPanel>
<DataGrid Name="gridIncrementalHistory" AutoGenerateColumns="True" MaxHeight="100" IsReadOnly="True" HeadersVisibility="Column" />
</DockPanel>
</GroupBox>
<GroupBox Header="Current Backup Files Working Set" Grid.Row="1" Margin="0 10 0 0" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<WrapPanel DockPanel.Dock="Top" Background="LightSteelBlue" Grid.Row="1" >
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="Working on Disc #:"/>
<Label Name="lblCurrentDisc" FontWeight="Bold" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Total Files Remaining: " />
<TextBlock Name="lblTotalFiles" Text="-" />
<TextBlock Text=" (" />
<TextBlock Name="lblTotalBytes" Text="-" />
<TextBlock Text=" Bytes)" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Remaining Discs Required: " />
<TextBlock Name="lblDiscCount" Text="-" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="10 0 0 0">
<CheckBox Content="Show Errors Only" Margin="0,5,0,0" Name="chkShowErrorsOnly" Click="chkShowErrorsOnly_Click" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Errors: " />
<TextBlock Name="lblErrorCount" Text="-" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5 0">
<Button Content="Select Next Disc's Worth Of Files" Margin="0 0 0 5" Click="IdentifyNextMediaSubset_Click" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Selected: " />
<TextBlock Name="lblQtySelected" Text="-" />
<TextBlock Text=" (" />
<TextBlock Name="lblBytesSelected" Text="-" />
<TextBlock Text=" Bytes)" />
</StackPanel>
</StackPanel>
<Button Content="Send Files To Burn Folder" Click="SymLinkToBurn_Click" />
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<RadioButton Name="rdoSymLink" Margin="0 0 15 5" Content="Symbolic Links" GroupName="BurnFolderCopyTypeRadioGroup" ToolTip="Many Burners (e.g. Nero) will copy SymLinks directly (i.e. not the file itself), which is worthless." />
<RadioButton Name="rdoTrueCopy" Content="True File Copy" IsChecked="True" GroupName="BurnFolderCopyTypeRadioGroup" />
</StackPanel>
<Button Content="Mark Current Disc Complete" Click="MediaSubsetCommit_Click" />
</WrapPanel>
<DataGrid Grid.Row="2" Grid.ColumnSpan="2" Name="gridFilesWorkingSet" IsReadOnly="True" HeadersVisibility="Column" AutoGenerateColumns="True" >
<DataGrid.Resources>
<!-- nugget: colorizing individual cell elements based on underlying data field values -->
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource PrettyDataGridCellStyle}">
<Style.Triggers>
<DataTrigger Value="True" Binding="{Binding Mode=OneWay, Path=Selected}">
<Setter Property="Background" Value="LightYellow" />
</DataTrigger>
<DataTrigger Value="True" Binding="{Binding Mode=OneWay, Path=SkipError}">
<Setter Property="Background" Value="Pink" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.Resources>
<!--DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Button Content="+" ToolTip="Add To Burn Folder" Click="AddSingleToBurn_Click" Padding="0" Margin="0" />
<Button Content="-" ToolTip="Remove From Burn Folder" Click="RemoveSingleToBurn_Click" Padding="0" Margin="0" />
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns-->
</DataGrid>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!--GridSplitter Grid.Row="1" ResizeDirection="Rows" Height="10" ResizeBehavior="PreviousAndNext" HorizontalAlignment="Stretch" /-->
<GroupBox Header="Selected Backup Folders">
<TreeView Name="treeFolders" ItemsSource="{Binding Source={x:Static global:FileSystemNode.RootDirectories}, Path=Values}"
BorderThickness="0" Padding="0 4 5 2" >
<!--nugget: binding to a Dictionary<> requires additional Path=Values -->
<TreeView.Resources>
<Style TargetType="CheckBox">
<Setter Property="Margin" Value="0 0 3 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="IsChecked" Value="{Binding Mode=TwoWay, Path=IsSelected}" />
<Setter Property="Background">
<Setter.Value>
<MultiBinding Converter="{local:FileTreeBackgroundBrushConverter}" Mode="OneWay">
<Binding Path="IsSelected" Mode="OneWay" />
<Binding Path="IsExcluded" Mode="OneWay" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
<!-- nugget: very odd, the exact same Style that worked for ComboBox wouldn't for TextBlock unless applied via StaticResource to the key'd Style??? -->
<Style x:Key="TreeTextBlock" TargetType="TextBlock">
<Setter Property="Padding" Value="2 0 4 1" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Text" Value="{Binding Mode=OneTime, Path=Name}" />
<Setter Property="Background">
<Setter.Value>
<MultiBinding Converter="{local:FileTreeBackgroundBrushConverter}" Mode="OneWay">
<Binding Path="IsSelected" Mode="OneWay" />
<Binding Path="IsExcluded" Mode="OneWay" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
<HierarchicalDataTemplate DataType="{x:Type global:FolderNode}" ItemsSource="{Binding Path=Children.Values}">
<WrapPanel>
<!--WrapPanel.ContextMenu>
<ContextMenu>
<MenuItem Header="Copy Path to Exclusions" Command="{x:Static local:RoutedCommands.CopyToExclusions}" CommandParameter="{Binding Mode=OneTime, Path=FullPath}" />
</ContextMenu>
</WrapPanel.ContextMenu-->
<CheckBox />
<TextBlock Text="*" ToolTip="Contains selections further down" Foreground="Red"
Visibility="{Binding Mode=OneWay, Path=IsSubSelected, Converter={conv:BooleanToVisibilityConverter}}" />
<TextBlock Style="{StaticResource TreeTextBlock}"
FontStyle="{Binding Mode=OneTime, Path=IsFunky, Converter={conv:BoolToItalicConverter}}"
Foreground="{Binding Mode=OneTime, Path=IsFunky, Converter={conv:BoolToSolidBrushConverter}, ConverterParameter='Red,Blue'}" />
<TextBlock Text="*!*" ToolTip="Previously recorded folder, no longer present" Foreground="Red"
Visibility="{Binding Mode=OneTime, Path=IsMissing, Converter={conv:BooleanToVisibilityConverter}}" />
</WrapPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type global:FileNode}" >
<WrapPanel>
<CheckBox />
<TextBlock Style="{StaticResource TreeTextBlock}" />
<TextBlock Text="*!*" ToolTip="Previously recorded file, no longer present" Foreground="Red"
Visibility="{Binding Mode=OneTime, Path=IsMissing, Converter={conv:BooleanToVisibilityConverter}}" />
</WrapPanel>
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
</GroupBox>
<!--GroupBox Grid.Row="2" >
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Exclusions" FontSize="15" />
<TextBlock Text="(found anywhere in the path)" VerticalAlignment="Bottom" />
</StackPanel>
</GroupBox.Header>
<TextBox TextWrapping="WrapWithOverflow" AcceptsReturn="True" Name="txtExclusions" />
</GroupBox-->
</Grid>
</Grid>
</Window>
Show details
Hide details
Change log
r16
by beej2020 on Feb 21, 2011
Diff
[No log message]
Go to:
/trunk/App/App.xaml.cs
/trunk/App/FileSystemNode.cs
/trunk/App/Helpers.cs
/trunk/App/MainWindow.xaml
/trunk/App/MainWindow.xaml.cs
/trunk/App/ReflectionHelpers.cs
/trunk/App/SqlClientHelpers.cs
/trunk/App/Styles.xaml
/trunk/App/WPFHelpers.cs
/trunk/App/WPFValueConverters.cs
/trunk/App/Win32Helpers.cs
/trunk/App/YASBE.csproj
/trunk/App/bin/Debug/YASBE.exe
/trunk/App/bin/Release/YASBE.exe
...App/bin/Release/YASBE.exe.config
/trunk/App/bin/Release/YASBE.pdb
...App/bin/Release/YASBE.vshost.exe
.../Release/YASBE.vshost.exe.config
...elease/YASBE.vshost.exe.manifest
/trunk/App/scratch.cs
...DBobj/BackupProfileFolders_s.sql
/trunk/DB/DBobj/BackupProfile_s.sql
...nk/DB/DBobj/BackupProfiles_s.sql
...obj/FavoriteTempBurnFolder_i.sql
...k/DB/DBobj/FileArchiveID_UDT.sql
...DB/DBobj/Files_UploadCompare.sql
...k/DB/DBobj/Incremental_Files.sql
...DBobj/Incremental_FullDetail.sql
/trunk/DB/DBobj/MediaSize_u.sql
.../DB/DBobj/MediaSubset_Commit.sql
/trunk/DB/DBobj/YASBE.sqlsuo
/trunk/DB/DBobj/YASBE.ssmssqlproj
/trunk/DB/DBobj/scratch
...iles_UploadCompare - old way.sql
...bj/scratch/Incremental_Files.sql
...ratch/Incremental_FullDetail.sql
Project members,
sign in
to write a code review
Older revisions
r15
by beej2020 on Feb 13, 2011
Diff
[No log message]
r14
by beej2020 on Feb 13, 2011
Diff
[No log message]
r13
by beej2020 on Feb 13, 2011
Diff
[No log message]
All revisions of this file
File info
Size: 15162 bytes, 297 lines
View raw file
Powered by
Google Project Hosting