fixed #272: Error handling for stopping FTP uploads

This commit is contained in:
Jaex 2014-09-13 10:36:16 +03:00
parent 248f4221e2
commit f469e0cc87
5 changed files with 21 additions and 5 deletions

View file

@ -140,7 +140,7 @@ public override void Prepare()
TaskEx.Run(() => TaskEx.Run(() =>
{ {
WindowsListAdvanced wla = new WindowsListAdvanced(); WindowsRectangleList wla = new WindowsRectangleList();
wla.IgnoreHandle = handle; wla.IgnoreHandle = handle;
wla.IncludeChildWindows = AreaManager.IncludeControls; wla.IncludeChildWindows = AreaManager.IncludeControls;
AreaManager.Windows = wla.GetWindowsRectangleList(); AreaManager.Windows = wla.GetWindowsRectangleList();

View file

@ -119,7 +119,7 @@
<Compile Include="Screenshot_Transparent.cs" /> <Compile Include="Screenshot_Transparent.cs" />
<Compile Include="WindowInfo.cs" /> <Compile Include="WindowInfo.cs" />
<Compile Include="WindowsList.cs" /> <Compile Include="WindowsList.cs" />
<Compile Include="WindowsListAdvanced.cs" /> <Compile Include="WindowsRectangleList.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\HelpersLib\HelpersLib.csproj"> <ProjectReference Include="..\HelpersLib\HelpersLib.csproj">

View file

@ -31,7 +31,7 @@
namespace ScreenCaptureLib namespace ScreenCaptureLib
{ {
public class WindowsListAdvanced public class WindowsRectangleList
{ {
public IntPtr IgnoreHandle { get; set; } public IntPtr IgnoreHandle { get; set; }
public bool IncludeChildWindows { get; set; } public bool IncludeChildWindows { get; set; }

View file

@ -138,7 +138,15 @@ public override void StopUpload()
if (IsUploading && !StopUploadRequested) if (IsUploading && !StopUploadRequested)
{ {
StopUploadRequested = true; StopUploadRequested = true;
Disconnect();
try
{
Disconnect();
}
catch (Exception e)
{
DebugHelper.WriteException(e);
}
} }
} }

View file

@ -96,7 +96,15 @@ public override void StopUpload()
if (IsUploading && !StopUploadRequested) if (IsUploading && !StopUploadRequested)
{ {
StopUploadRequested = true; StopUploadRequested = true;
Disconnect();
try
{
Disconnect();
}
catch (Exception e)
{
DebugHelper.WriteException(e);
}
} }
} }