Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
Fix the exception of exporting file after saving.
Fix the error of handling exception in saving thread.
  • Loading branch information
aianlinb committed Oct 1, 2020
1 parent 468b244 commit 19f825c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 0 additions & 2 deletions LibBundle/BundleContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ private void Initialize(BinaryReader br)
//UnPacking
public MemoryStream Read(BinaryReader br = null)
{
if (dataToSave != null)
throw new NotSupportedException("Save() cannot be called when it's implemented using a constructor with data and path parameters");
if (br == null)
if (path == null)
throw new ArgumentException("BundleContainer implemented using a constructor with BinaryReader parameters must include the br parameter when calling Read()", "br");
Expand Down
4 changes: 2 additions & 2 deletions LibBundle/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// 您可以指定所有的值,也可以使用 '*' 將組建和修訂編號
// 設為預設,如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
4 changes: 2 additions & 2 deletions VisualBundle/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Window x:Class="VisualBundle.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="VisualBundle v1.1.0" Height="480" Width="800" Loaded="OnLoaded" Closing="OnWindowClosing">
Title="VisualBundle v1.2.0" Height="480" Width="800" Loaded="OnLoaded" Closing="OnWindowClosing">
<Window.Resources>
<HierarchicalDataTemplate x:Key="FileViewItemTemplate" DataType="x:Type self:ItemModel" ItemsSource="{Binding ChildItems}">
<HierarchicalDataTemplate x:Key="FileViewItemTemplate" DataType="x:Type VisualBundle:ItemModel" ItemsSource="{Binding ChildItems}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Icon}" Width="20" Height="20"/>
<TextBlock Text="{Binding Name}" FontSize="16"/>
Expand Down
16 changes: 9 additions & 7 deletions VisualBundle/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,15 @@ private void OnButtonSaveClick(object sender, RoutedEventArgs e)
Dispatcher.Invoke(sw.Close);
} catch (Exception ex)
{
var ew = new ErrorWindow();
var tr = new Thread(new ParameterizedThreadStart(ew.ShowError))
{
CurrentUICulture = new System.Globalization.CultureInfo("en-US")
};
tr.Start(ex);
Dispatcher.Invoke(() => { if (ew.ShowDialog() != true) Close(); });
Dispatcher.Invoke(() => {
var ew = new ErrorWindow();
var tr = new Thread(new ParameterizedThreadStart(ew.ShowError))
{
CurrentUICulture = new System.Globalization.CultureInfo("en-US")
};
tr.Start(ex);
if (ew.ShowDialog() != true) Close();
});
}
}));
t.Start();
Expand Down
4 changes: 2 additions & 2 deletions VisualBundle/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
// 您可以指定所有的值,也可以使用 '*' 將組建和修訂編號
// 設為預設,如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
2 changes: 1 addition & 1 deletion VisualBundle/SavingWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Window x:Class="VisualBundle.SavingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Saving" Height="100" Width="300">
Title="Saving" Height="100" Width="300" WindowStartupLocation="CenterScreen">
<Grid>
<TextBlock x:Name="TextBlock1" TextWrapping="Wrap" Text="Saving 0 / 0 bundles . . ." VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
Expand Down

0 comments on commit 19f825c

Please sign in to comment.