mirror of
https://github.com/fadden/6502bench.git
synced 2024-09-06 01:55:11 +00:00
Allow multiple files to be added at once in file concatenator
Also, show the current number of elements.
This commit is contained in:
parent
5b75ae35fc
commit
d7593181f5
@ -47,7 +47,8 @@ limitations under the License.
|
|||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Grid.Row="0" Text="Select files:" Margin="0,0,0,4"/>
|
<TextBlock Grid.Row="0" Margin="0,0,0,4"
|
||||||
|
Text="{Binding ConcatItems.Count, StringFormat={}File list ({0} items):}"/>
|
||||||
|
|
||||||
<DataGrid Name="concatGrid" Grid.Row="1" Height="300" Width="480"
|
<DataGrid Name="concatGrid" Grid.Row="1" Height="300" Width="480"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
|
@ -113,6 +113,7 @@ namespace SourceGen.Tools.WpfGui {
|
|||||||
OpenFileDialog fileDlg = new OpenFileDialog() {
|
OpenFileDialog fileDlg = new OpenFileDialog() {
|
||||||
Filter = Res.Strings.FILE_FILTER_ALL,
|
Filter = Res.Strings.FILE_FILTER_ALL,
|
||||||
FilterIndex = 0,
|
FilterIndex = 0,
|
||||||
|
Multiselect = true,
|
||||||
Title = (string)FindResource("str_SelectFileTitle")
|
Title = (string)FindResource("str_SelectFileTitle")
|
||||||
};
|
};
|
||||||
if (fileDlg.ShowDialog() != true) {
|
if (fileDlg.ShowDialog() != true) {
|
||||||
@ -120,11 +121,13 @@ namespace SourceGen.Tools.WpfGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
string pathName = Path.GetFullPath(fileDlg.FileName);
|
foreach (string pathName in fileDlg.FileNames) {
|
||||||
|
// The names in FileNames appear to be fully qualified.
|
||||||
long length = new FileInfo(pathName).Length;
|
long length = new FileInfo(pathName).Length;
|
||||||
uint crc32 = CRC32.OnWholeFile(pathName);
|
uint crc32 = CRC32.OnWholeFile(pathName);
|
||||||
ConcatItems.Add(new ConcatItem(pathName, length, crc32));
|
ConcatItems.Add(new ConcatItem(pathName, length, crc32));
|
||||||
concatGrid.SelectedIndex = ConcatItems.Count - 1;
|
concatGrid.SelectedIndex = ConcatItems.Count - 1;
|
||||||
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
string caption = (string)FindResource("str_FileAccessFailedCaption");
|
string caption = (string)FindResource("str_FileAccessFailedCaption");
|
||||||
string fmt = (string)FindResource("str_FileAccessFailedFmt");
|
string fmt = (string)FindResource("str_FileAccessFailedFmt");
|
||||||
|
Loading…
Reference in New Issue
Block a user