mirror of
https://github.com/claunia/apprepodbmgr.git
synced 2025-12-16 19:24:42 +00:00
Prevent aborted threads from raising events.
This commit is contained in:
@@ -348,8 +348,6 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
if(!stopped)
|
||||
MessageBox.Show(text, MessageBoxType.Error);
|
||||
if(thdCheckFiles != null)
|
||||
thdCheckFiles.Abort();
|
||||
prgProgress.Visible = false;
|
||||
btnStop.Visible = false;
|
||||
btnClose.Visible = false;
|
||||
@@ -360,6 +358,8 @@ namespace osrepodbmgr.Eto
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
Workers.AddFile -= AddFile;
|
||||
Workers.AddOS -= AddOS;
|
||||
if(thdCheckFiles != null)
|
||||
thdCheckFiles.Abort();
|
||||
thdHashFiles = null;
|
||||
if(fileView != null)
|
||||
fileView.Clear();
|
||||
@@ -375,9 +375,6 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
if(thdCheckFiles != null)
|
||||
thdCheckFiles.Abort();
|
||||
|
||||
Workers.Failed -= ChkFilesFailed;
|
||||
Workers.Finished -= ChkFilesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
@@ -385,6 +382,9 @@ namespace osrepodbmgr.Eto
|
||||
Workers.AddFile -= AddFile;
|
||||
Workers.AddOS -= AddOS;
|
||||
|
||||
if(thdCheckFiles != null)
|
||||
thdCheckFiles.Abort();
|
||||
|
||||
thdHashFiles = null;
|
||||
prgProgress.Visible = false;
|
||||
btnStop.Visible = false;
|
||||
@@ -604,6 +604,27 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
stopped = true;
|
||||
|
||||
Workers.AddFile -= AddFile;
|
||||
Workers.AddOS -= AddOS;
|
||||
Workers.Failed -= AddFilesToDbFailed;
|
||||
Workers.Failed -= ChkFilesFailed;
|
||||
Workers.Failed -= ExtractArchiveFailed;
|
||||
Workers.Failed -= FindFilesFailed;
|
||||
Workers.Failed -= HashFilesFailed;
|
||||
Workers.Failed -= OpenArchiveFailed;
|
||||
Workers.Failed -= PackFilesFailed;
|
||||
Workers.Failed -= RemoveTempFilesFailed;
|
||||
Workers.Finished -= AddFilesToDbFinished;
|
||||
Workers.Finished -= ChkFilesFinished;
|
||||
Workers.Finished -= ExtractArchiveFinished;
|
||||
Workers.Finished -= FindFilesFinished;
|
||||
Workers.Finished -= HashFilesFinished;
|
||||
Workers.Finished -= OpenArchiveFinished;
|
||||
Workers.Finished -= RemoveTempFilesFinished;
|
||||
Workers.FinishedWithText -= PackFilesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdFindFiles != null)
|
||||
{
|
||||
thdFindFiles.Abort();
|
||||
@@ -793,13 +814,13 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
if(thdAddFiles != null)
|
||||
thdAddFiles.Abort();
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.Finished -= AddFilesToDbFinished;
|
||||
Workers.Failed -= AddFilesToDbFailed;
|
||||
|
||||
if(thdAddFiles != null)
|
||||
thdAddFiles.Abort();
|
||||
|
||||
long counter = 0;
|
||||
fileView.Clear();
|
||||
foreach(KeyValuePair<string, DBOSFile> kvp in Context.hashes)
|
||||
@@ -833,13 +854,13 @@ namespace osrepodbmgr.Eto
|
||||
if(!stopped)
|
||||
MessageBox.Show(text, MessageBoxType.Error);
|
||||
|
||||
if(thdAddFiles != null)
|
||||
thdAddFiles.Abort();
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.Finished -= AddFilesToDbFinished;
|
||||
Workers.Failed -= AddFilesToDbFailed;
|
||||
|
||||
if(thdAddFiles != null)
|
||||
thdAddFiles.Abort();
|
||||
|
||||
ChkFilesFinished();
|
||||
});
|
||||
}
|
||||
@@ -896,9 +917,6 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
if(thdPackFiles != null)
|
||||
thdPackFiles.Abort();
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
Workers.FinishedWithText -= PackFilesFinished;
|
||||
@@ -906,6 +924,9 @@ namespace osrepodbmgr.Eto
|
||||
prgProgress2.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
|
||||
if(thdPackFiles != null)
|
||||
thdPackFiles.Abort();
|
||||
|
||||
AddToDatabase();
|
||||
|
||||
MessageBox.Show(text);
|
||||
@@ -919,14 +940,14 @@ namespace osrepodbmgr.Eto
|
||||
if(!stopped)
|
||||
MessageBox.Show(text, MessageBoxType.Error);
|
||||
|
||||
if(thdPackFiles != null)
|
||||
thdPackFiles.Abort();
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
Workers.FinishedWithText -= PackFilesFinished;
|
||||
Workers.Failed -= PackFilesFailed;
|
||||
|
||||
if(thdPackFiles != null)
|
||||
thdPackFiles.Abort();
|
||||
|
||||
btnRemoveFile.Enabled = true;
|
||||
btnPack.Enabled = true;
|
||||
btnClose.Enabled = true;
|
||||
@@ -1058,8 +1079,6 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
if(thdExtractArchive != null)
|
||||
thdExtractArchive.Abort();
|
||||
stopped = false;
|
||||
lblProgress.Text = "Finding files";
|
||||
lblProgress.Visible = true;
|
||||
@@ -1074,6 +1093,8 @@ namespace osrepodbmgr.Eto
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
prgProgress.Indeterminate = true;
|
||||
|
||||
if(thdExtractArchive != null)
|
||||
thdExtractArchive.Abort();
|
||||
thdFindFiles = new Thread(Workers.FindFiles);
|
||||
Workers.Failed += FindFilesFailed;
|
||||
Workers.Finished += FindFilesFinished;
|
||||
|
||||
@@ -180,15 +180,15 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
Workers.Failed -= LoadOSesFailed;
|
||||
Workers.Finished -= LoadOSesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.AddOS -= AddOS;
|
||||
if(thdPopulateOSes != null)
|
||||
{
|
||||
thdPopulateOSes.Abort();
|
||||
thdPopulateOSes = null;
|
||||
}
|
||||
Workers.Failed -= LoadOSesFailed;
|
||||
Workers.Finished -= LoadOSesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.AddOS -= AddOS;
|
||||
lblProgress.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
treeOSes.Enabled = true;
|
||||
@@ -316,11 +316,6 @@ namespace osrepodbmgr.Eto
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
MessageBox.Show(text, MessageBoxButtons.OK, MessageBoxType.Error);
|
||||
if(thdSaveAs != null)
|
||||
{
|
||||
thdSaveAs.Abort();
|
||||
thdSaveAs = null;
|
||||
}
|
||||
|
||||
lblProgress.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
@@ -340,6 +335,12 @@ namespace osrepodbmgr.Eto
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdSaveAs != null)
|
||||
{
|
||||
thdSaveAs.Abort();
|
||||
thdSaveAs = null;
|
||||
}
|
||||
|
||||
Context.path = null;
|
||||
});
|
||||
}
|
||||
@@ -348,12 +349,6 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
if(thdSaveAs != null)
|
||||
{
|
||||
thdSaveAs.Abort();
|
||||
thdSaveAs = null;
|
||||
}
|
||||
|
||||
lblProgress.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
@@ -371,6 +366,12 @@ namespace osrepodbmgr.Eto
|
||||
Workers.Finished -= SaveAsFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
|
||||
if(thdSaveAs != null)
|
||||
{
|
||||
thdSaveAs.Abort();
|
||||
thdSaveAs = null;
|
||||
}
|
||||
|
||||
MessageBox.Show(string.Format("Correctly saved to {0}", Context.path));
|
||||
|
||||
Context.path = null;
|
||||
@@ -397,6 +398,16 @@ namespace osrepodbmgr.Eto
|
||||
|
||||
protected void OnBtnStopClicked(object sender, EventArgs e)
|
||||
{
|
||||
Workers.AddOS -= AddOS;
|
||||
Workers.Failed -= CompressToFailed;
|
||||
Workers.Failed -= LoadOSesFailed;
|
||||
Workers.Failed -= SaveAsFailed;
|
||||
Workers.Finished -= CompressToFinished;
|
||||
Workers.Finished -= LoadOSesFinished;
|
||||
Workers.Finished -= SaveAsFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdPopulateOSes != null)
|
||||
{
|
||||
thdPopulateOSes.Abort();
|
||||
@@ -459,12 +470,6 @@ namespace osrepodbmgr.Eto
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
MessageBox.Show(text, MessageBoxButtons.OK, MessageBoxType.Error);
|
||||
if(thdCompressTo != null)
|
||||
{
|
||||
thdCompressTo.Abort();
|
||||
thdCompressTo = null;
|
||||
}
|
||||
|
||||
lblProgress.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
@@ -483,6 +488,12 @@ namespace osrepodbmgr.Eto
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdCompressTo != null)
|
||||
{
|
||||
thdCompressTo.Abort();
|
||||
thdCompressTo = null;
|
||||
}
|
||||
|
||||
Context.path = null;
|
||||
});
|
||||
}
|
||||
@@ -491,12 +502,6 @@ namespace osrepodbmgr.Eto
|
||||
{
|
||||
Application.Instance.Invoke(delegate
|
||||
{
|
||||
if(thdCompressTo != null)
|
||||
{
|
||||
thdCompressTo.Abort();
|
||||
thdCompressTo = null;
|
||||
}
|
||||
|
||||
lblProgress.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
@@ -515,6 +520,12 @@ namespace osrepodbmgr.Eto
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdCompressTo != null)
|
||||
{
|
||||
thdCompressTo.Abort();
|
||||
thdCompressTo = null;
|
||||
}
|
||||
|
||||
MessageBox.Show(string.Format("Correctly compressed as {0}", Context.path));
|
||||
|
||||
Context.path = null;
|
||||
|
||||
@@ -305,10 +305,6 @@ public partial class dlgAdd : Dialog
|
||||
dlgMsg.Run();
|
||||
dlgMsg.Destroy();
|
||||
}
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
if(thdCheckFiles != null)
|
||||
thdCheckFiles.Abort();
|
||||
prgProgress.Visible = false;
|
||||
btnStop.Visible = false;
|
||||
btnClose.Visible = false;
|
||||
@@ -319,6 +315,10 @@ public partial class dlgAdd : Dialog
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
Workers.AddFile -= AddFile;
|
||||
Workers.AddOS -= AddOS;
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
if(thdCheckFiles != null)
|
||||
thdCheckFiles.Abort();
|
||||
thdHashFiles = null;
|
||||
if(fileView != null)
|
||||
fileView.Clear();
|
||||
@@ -334,9 +334,6 @@ public partial class dlgAdd : Dialog
|
||||
{
|
||||
Application.Invoke(delegate
|
||||
{
|
||||
if(thdCheckFiles != null)
|
||||
thdCheckFiles.Abort();
|
||||
|
||||
Workers.Failed -= ChkFilesFailed;
|
||||
Workers.Finished -= ChkFilesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
@@ -344,6 +341,8 @@ public partial class dlgAdd : Dialog
|
||||
Workers.AddFile -= AddFile;
|
||||
Workers.AddOS -= AddOS;
|
||||
|
||||
if(thdCheckFiles != null)
|
||||
thdCheckFiles.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
thdHashFiles = null;
|
||||
@@ -558,6 +557,27 @@ public partial class dlgAdd : Dialog
|
||||
{
|
||||
stopped = true;
|
||||
|
||||
Workers.AddFile -= AddFile;
|
||||
Workers.AddOS -= AddOS;
|
||||
Workers.Failed -= AddFilesToDbFailed;
|
||||
Workers.Failed -= ChkFilesFailed;
|
||||
Workers.Failed -= ExtractArchiveFailed;
|
||||
Workers.Failed -= FindFilesFailed;
|
||||
Workers.Failed -= HashFilesFailed;
|
||||
Workers.Failed -= OpenArchiveFailed;
|
||||
Workers.Failed -= PackFilesFailed;
|
||||
Workers.Failed -= RemoveTempFilesFailed;
|
||||
Workers.Finished -= AddFilesToDbFinished;
|
||||
Workers.Finished -= ChkFilesFinished;
|
||||
Workers.Finished -= ExtractArchiveFinished;
|
||||
Workers.Finished -= FindFilesFinished;
|
||||
Workers.Finished -= HashFilesFinished;
|
||||
Workers.Finished -= OpenArchiveFinished;
|
||||
Workers.Finished -= RemoveTempFilesFinished;
|
||||
Workers.FinishedWithText -= PackFilesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
@@ -775,15 +795,15 @@ public partial class dlgAdd : Dialog
|
||||
{
|
||||
Application.Invoke(delegate
|
||||
{
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.Finished -= AddFilesToDbFinished;
|
||||
Workers.Failed -= AddFilesToDbFailed;
|
||||
|
||||
if(thdAddFiles != null)
|
||||
thdAddFiles.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.Finished -= AddFilesToDbFinished;
|
||||
Workers.Failed -= AddFilesToDbFailed;
|
||||
|
||||
long counter = 0;
|
||||
fileView.Clear();
|
||||
foreach(KeyValuePair<string, DBOSFile> kvp in Context.hashes)
|
||||
@@ -820,15 +840,15 @@ public partial class dlgAdd : Dialog
|
||||
dlgMsg.Destroy();
|
||||
}
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.Finished -= AddFilesToDbFinished;
|
||||
Workers.Failed -= AddFilesToDbFailed;
|
||||
|
||||
if(thdAddFiles != null)
|
||||
thdAddFiles.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.Finished -= AddFilesToDbFinished;
|
||||
Workers.Failed -= AddFilesToDbFailed;
|
||||
|
||||
ChkFilesFinished();
|
||||
});
|
||||
}
|
||||
@@ -886,11 +906,6 @@ public partial class dlgAdd : Dialog
|
||||
{
|
||||
Application.Invoke(delegate
|
||||
{
|
||||
if(thdPackFiles != null)
|
||||
thdPackFiles.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
Workers.FinishedWithText -= PackFilesFinished;
|
||||
@@ -898,6 +913,11 @@ public partial class dlgAdd : Dialog
|
||||
prgProgress2.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
|
||||
if(thdPackFiles != null)
|
||||
thdPackFiles.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
|
||||
AddToDatabase();
|
||||
|
||||
MessageDialog dlgMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, "Correctly packed to " + text);
|
||||
@@ -917,16 +937,16 @@ public partial class dlgAdd : Dialog
|
||||
dlgMsg.Destroy();
|
||||
}
|
||||
|
||||
if(thdPackFiles != null)
|
||||
thdPackFiles.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
Workers.FinishedWithText -= PackFilesFinished;
|
||||
Workers.Failed -= PackFilesFailed;
|
||||
|
||||
if(thdPackFiles != null)
|
||||
thdPackFiles.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
|
||||
btnRemoveFile.Sensitive = true;
|
||||
btnPack.Sensitive = true;
|
||||
btnClose.Sensitive = true;
|
||||
@@ -1098,10 +1118,6 @@ public partial class dlgAdd : Dialog
|
||||
{
|
||||
Application.Invoke(delegate
|
||||
{
|
||||
if(thdExtractArchive != null)
|
||||
thdExtractArchive.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
stopped = false;
|
||||
lblProgress.Text = "Finding files";
|
||||
lblProgress.Visible = true;
|
||||
@@ -1114,6 +1130,10 @@ public partial class dlgAdd : Dialog
|
||||
Workers.Finished -= ExtractArchiveFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
if(thdExtractArchive != null)
|
||||
thdExtractArchive.Abort();
|
||||
if(thdPulseProgress != null)
|
||||
thdPulseProgress.Abort();
|
||||
thdPulseProgress = new Thread(() =>
|
||||
{
|
||||
while(true)
|
||||
|
||||
@@ -130,6 +130,9 @@ namespace osrepodbmgr
|
||||
string.Format("Error {0} when populating OSes file, exiting...", text));
|
||||
dlgMsg.Run();
|
||||
dlgMsg.Destroy();
|
||||
Workers.Failed -= LoadOSesFailed;
|
||||
Workers.Finished -= LoadOSesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
@@ -140,9 +143,6 @@ namespace osrepodbmgr
|
||||
thdPopulateOSes.Abort();
|
||||
thdPopulateOSes = null;
|
||||
}
|
||||
Workers.Failed -= LoadOSesFailed;
|
||||
Workers.Finished -= LoadOSesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Application.Quit();
|
||||
});
|
||||
}
|
||||
@@ -151,6 +151,9 @@ namespace osrepodbmgr
|
||||
{
|
||||
Application.Invoke(delegate
|
||||
{
|
||||
Workers.Failed -= LoadOSesFailed;
|
||||
Workers.Finished -= LoadOSesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
@@ -161,9 +164,6 @@ namespace osrepodbmgr
|
||||
thdPopulateOSes.Abort();
|
||||
thdPopulateOSes = null;
|
||||
}
|
||||
Workers.Failed -= LoadOSesFailed;
|
||||
Workers.Finished -= LoadOSesFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
lblProgress.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
treeOSes.Sensitive = true;
|
||||
@@ -305,17 +305,6 @@ namespace osrepodbmgr
|
||||
MessageDialog dlgMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, text);
|
||||
dlgMsg.Run();
|
||||
dlgMsg.Destroy();
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
thdPulseProgress = null;
|
||||
}
|
||||
if(thdSaveAs != null)
|
||||
{
|
||||
thdSaveAs.Abort();
|
||||
thdSaveAs = null;
|
||||
}
|
||||
|
||||
lblProgress.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
@@ -334,14 +323,6 @@ namespace osrepodbmgr
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
Context.path = null;
|
||||
});
|
||||
}
|
||||
|
||||
public void SaveAsFinished()
|
||||
{
|
||||
Application.Invoke(delegate
|
||||
{
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
@@ -353,6 +334,14 @@ namespace osrepodbmgr
|
||||
thdSaveAs = null;
|
||||
}
|
||||
|
||||
Context.path = null;
|
||||
});
|
||||
}
|
||||
|
||||
public void SaveAsFinished()
|
||||
{
|
||||
Application.Invoke(delegate
|
||||
{
|
||||
lblProgress.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
@@ -370,6 +359,17 @@ namespace osrepodbmgr
|
||||
Workers.Finished -= SaveAsFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
thdPulseProgress = null;
|
||||
}
|
||||
if(thdSaveAs != null)
|
||||
{
|
||||
thdSaveAs.Abort();
|
||||
thdSaveAs = null;
|
||||
}
|
||||
|
||||
MessageDialog dlgMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok,
|
||||
string.Format("Correctly saved to {0}", Context.path));
|
||||
dlgMsg.Run();
|
||||
@@ -401,6 +401,15 @@ namespace osrepodbmgr
|
||||
|
||||
protected void OnBtnStopClicked(object sender, EventArgs e)
|
||||
{
|
||||
Workers.Failed -= CompressToFailed;
|
||||
Workers.Failed -= LoadOSesFailed;
|
||||
Workers.Failed -= SaveAsFailed;
|
||||
Workers.Finished -= CompressToFinished;
|
||||
Workers.Finished -= LoadOSesFinished;
|
||||
Workers.Finished -= SaveAsFinished;
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
@@ -482,16 +491,6 @@ namespace osrepodbmgr
|
||||
MessageDialog dlgMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, text);
|
||||
dlgMsg.Run();
|
||||
dlgMsg.Destroy();
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
thdPulseProgress = null;
|
||||
}
|
||||
if(thdCompressTo != null)
|
||||
{
|
||||
thdCompressTo.Abort();
|
||||
thdCompressTo = null;
|
||||
}
|
||||
|
||||
lblProgress.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
@@ -511,6 +510,17 @@ namespace osrepodbmgr
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
thdPulseProgress = null;
|
||||
}
|
||||
if(thdCompressTo != null)
|
||||
{
|
||||
thdCompressTo.Abort();
|
||||
thdCompressTo = null;
|
||||
}
|
||||
|
||||
Context.path = null;
|
||||
});
|
||||
}
|
||||
@@ -519,17 +529,6 @@ namespace osrepodbmgr
|
||||
{
|
||||
Application.Invoke(delegate
|
||||
{
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
thdPulseProgress = null;
|
||||
}
|
||||
if(thdCompressTo != null)
|
||||
{
|
||||
thdCompressTo.Abort();
|
||||
thdCompressTo = null;
|
||||
}
|
||||
|
||||
lblProgress.Visible = false;
|
||||
lblProgress2.Visible = false;
|
||||
prgProgress.Visible = false;
|
||||
@@ -548,6 +547,17 @@ namespace osrepodbmgr
|
||||
Workers.UpdateProgress -= UpdateProgress;
|
||||
Workers.UpdateProgress2 -= UpdateProgress2;
|
||||
|
||||
if(thdPulseProgress != null)
|
||||
{
|
||||
thdPulseProgress.Abort();
|
||||
thdPulseProgress = null;
|
||||
}
|
||||
if(thdCompressTo != null)
|
||||
{
|
||||
thdCompressTo.Abort();
|
||||
thdCompressTo = null;
|
||||
}
|
||||
|
||||
MessageDialog dlgMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok,
|
||||
string.Format("Correctly compressed as {0}", Context.path));
|
||||
dlgMsg.Run();
|
||||
|
||||
Reference in New Issue
Block a user