mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-04 04:06:05 +13:00
fixed #272: Error handling for stopping FTP uploads
This commit is contained in:
parent
248f4221e2
commit
f469e0cc87
5 changed files with 21 additions and 5 deletions
|
@ -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();
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
|
||||||
|
|
||||||
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; }
|
|
@ -138,8 +138,16 @@ public override void StopUpload()
|
||||||
if (IsUploading && !StopUploadRequested)
|
if (IsUploading && !StopUploadRequested)
|
||||||
{
|
{
|
||||||
StopUploadRequested = true;
|
StopUploadRequested = true;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
Disconnect();
|
Disconnect();
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
DebugHelper.WriteException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion FileUploader methods
|
#endregion FileUploader methods
|
||||||
|
|
|
@ -96,8 +96,16 @@ public override void StopUpload()
|
||||||
if (IsUploading && !StopUploadRequested)
|
if (IsUploading && !StopUploadRequested)
|
||||||
{
|
{
|
||||||
StopUploadRequested = true;
|
StopUploadRequested = true;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
Disconnect();
|
Disconnect();
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
DebugHelper.WriteException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion FileUploader methods
|
#endregion FileUploader methods
|
||||||
|
|
Loading…
Reference in a new issue