Refactor: Rename Core.Core to Core.Workers

This commit is contained in:
2017-05-10 21:06:28 +01:00
parent 17b464012c
commit 28a89bcf6e
9 changed files with 178 additions and 163 deletions

View File

@@ -1,3 +1,11 @@
2017-05-10 Natalia Portillo <claunia@claunia.com>
* Context.cs:
* Workers.cs:
* DicWorkers.cs:
* osrepodbmgr.Core.csproj:
Refactor: Rename Core.Core to Core.Workers
2017-05-10 Natalia Portillo <claunia@claunia.com> 2017-05-10 Natalia Portillo <claunia@claunia.com>
* Core.cs: * Core.cs:

View File

@@ -55,10 +55,10 @@ namespace osrepodbmgr.Core
public static void CheckUnar() public static void CheckUnar()
{ {
Core.Finished += CheckUnarFinished; Workers.Finished += CheckUnarFinished;
Core.Failed += CheckUnarFailed; Workers.Failed += CheckUnarFailed;
Thread thdCheckUnar = new Thread(Core.CheckUnar); Thread thdCheckUnar = new Thread(Workers.CheckUnar);
thdCheckUnar.Start(); thdCheckUnar.Start();
} }
@@ -67,8 +67,8 @@ namespace osrepodbmgr.Core
unarUsable = true; unarUsable = true;
if(UnarChangeStatus != null) if(UnarChangeStatus != null)
UnarChangeStatus(); UnarChangeStatus();
Core.Finished -= CheckUnarFinished; Workers.Finished -= CheckUnarFinished;
Core.Failed -= CheckUnarFailed; Workers.Failed -= CheckUnarFailed;
} }
static void CheckUnarFailed(string text) static void CheckUnarFailed(string text)
@@ -76,8 +76,8 @@ namespace osrepodbmgr.Core
unarUsable = false; unarUsable = false;
if(UnarChangeStatus != null) if(UnarChangeStatus != null)
UnarChangeStatus(); UnarChangeStatus();
Core.Finished -= CheckUnarFinished; Workers.Finished -= CheckUnarFinished;
Core.Failed -= CheckUnarFailed; Workers.Failed -= CheckUnarFailed;
} }
} }
} }

View File

@@ -38,7 +38,7 @@ using Schemas;
namespace osrepodbmgr.Core namespace osrepodbmgr.Core
{ {
public static partial class Core public static partial class Workers
{ {
public static void AddMedia() public static void AddMedia()
{ {

View File

@@ -40,7 +40,7 @@ using Schemas;
namespace osrepodbmgr.Core namespace osrepodbmgr.Core
{ {
public static partial class Core public static partial class Workers
{ {
// Sets a 128Kbyte buffer // Sets a 128Kbyte buffer
const long bufferSize = 131072; const long bufferSize = 131072;

View File

@@ -46,12 +46,12 @@
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Checksum.cs" /> <Compile Include="Checksum.cs" />
<Compile Include="Core.cs" /> <Compile Include="Workers.cs" />
<Compile Include="DBCore.cs" /> <Compile Include="DBCore.cs" />
<Compile Include="DBOps.cs" /> <Compile Include="DBOps.cs" />
<Compile Include="DetectImageFormat.cs" /> <Compile Include="DetectImageFormat.cs" />
<Compile Include="DetectOS.cs" /> <Compile Include="DetectOS.cs" />
<Compile Include="DicCore.cs" /> <Compile Include="DicWorkers.cs" />
<Compile Include="PlatformID.cs" /> <Compile Include="PlatformID.cs" />
<Compile Include="PluginBase.cs" /> <Compile Include="PluginBase.cs" />
<Compile Include="Schema.cs" /> <Compile Include="Schema.cs" />

View File

@@ -1,3 +1,10 @@
2017-05-10 Natalia Portillo <claunia@claunia.com>
* frmAdd.cs:
* dlgMetadata.cs:
* frmSettings.cs:
Refactor: Rename Core.Core to Core.Workers
2017-05-10 Natalia Portillo <claunia@claunia.com> 2017-05-10 Natalia Portillo <claunia@claunia.com>
* frmAdd.cs: * frmAdd.cs:

View File

@@ -720,15 +720,15 @@ namespace osrepodbmgr
buttonOk.Visible = false; buttonOk.Visible = false;
btnEditDisc.Visible = false; btnEditDisc.Visible = false;
btnClearDiscs.Visible = false; btnClearDiscs.Visible = false;
Core.Core.Failed += OnDiscAddFailed; Core.Workers.Failed += OnDiscAddFailed;
Core.Core.Finished += OnDiscAddFinished; Core.Workers.Finished += OnDiscAddFinished;
Core.Core.UpdateProgress += UpdateDiscProgress1; Core.Workers.UpdateProgress += UpdateDiscProgress1;
Core.Core.UpdateProgress2 += UpdateDiscProgress2; Core.Workers.UpdateProgress2 += UpdateDiscProgress2;
Context.workingDisc = null; Context.workingDisc = null;
btnStopAddDisc.Visible = true; btnStopAddDisc.Visible = true;
btnAddDisc.Visible = false; btnAddDisc.Visible = false;
btnRemoveDiscs.Visible = false; btnRemoveDiscs.Visible = false;
thdDisc = new Thread(Core.Core.AddMedia); thdDisc = new Thread(Core.Workers.AddMedia);
thdDisc.Start(); thdDisc.Start();
} }
@@ -789,10 +789,10 @@ namespace osrepodbmgr
buttonOk.Visible = true; buttonOk.Visible = true;
btnEditDisc.Visible = true; btnEditDisc.Visible = true;
btnClearDiscs.Visible = true; btnClearDiscs.Visible = true;
Core.Core.Failed -= OnDiscAddFailed; Core.Workers.Failed -= OnDiscAddFailed;
Core.Core.Finished -= OnDiscAddFinished; Core.Workers.Finished -= OnDiscAddFinished;
Core.Core.UpdateProgress -= UpdateDiscProgress1; Core.Workers.UpdateProgress -= UpdateDiscProgress1;
Core.Core.UpdateProgress2 -= UpdateDiscProgress2; Core.Workers.UpdateProgress2 -= UpdateDiscProgress2;
Context.workingDisc = null; Context.workingDisc = null;
btnStopAddDisc.Visible = false; btnStopAddDisc.Visible = false;
btnAddDisc.Visible = true; btnAddDisc.Visible = true;
@@ -906,10 +906,10 @@ namespace osrepodbmgr
buttonOk.Visible = true; buttonOk.Visible = true;
btnEditDisc.Visible = true; btnEditDisc.Visible = true;
btnClearDiscs.Visible = true; btnClearDiscs.Visible = true;
Core.Core.Failed -= OnDiscAddFailed; Core.Workers.Failed -= OnDiscAddFailed;
Core.Core.Finished -= OnDiscAddFinished; Core.Workers.Finished -= OnDiscAddFinished;
Core.Core.UpdateProgress -= UpdateDiscProgress1; Core.Workers.UpdateProgress -= UpdateDiscProgress1;
Core.Core.UpdateProgress2 -= UpdateDiscProgress2; Core.Workers.UpdateProgress2 -= UpdateDiscProgress2;
Context.workingDisc = null; Context.workingDisc = null;
btnStopAddDisc.Visible = false; btnStopAddDisc.Visible = false;
btnAddDisc.Visible = true; btnAddDisc.Visible = true;
@@ -952,15 +952,15 @@ namespace osrepodbmgr
buttonOk.Visible = false; buttonOk.Visible = false;
btnEditDisk.Visible = false; btnEditDisk.Visible = false;
btnClearDisks.Visible = false; btnClearDisks.Visible = false;
Core.Core.Failed += OnDiskAddFailed; Core.Workers.Failed += OnDiskAddFailed;
Core.Core.Finished += OnDiskAddFinished; Core.Workers.Finished += OnDiskAddFinished;
Core.Core.UpdateProgress += UpdateDiskProgress1; Core.Workers.UpdateProgress += UpdateDiskProgress1;
Core.Core.UpdateProgress2 += UpdateDiskProgress2; Core.Workers.UpdateProgress2 += UpdateDiskProgress2;
Context.workingDisk = null; Context.workingDisk = null;
btnStopAddDisk.Visible = true; btnStopAddDisk.Visible = true;
btnAddDisk.Visible = false; btnAddDisk.Visible = false;
btnRemoveDisk.Visible = false; btnRemoveDisk.Visible = false;
thdDisk = new Thread(Core.Core.AddMedia); thdDisk = new Thread(Core.Workers.AddMedia);
thdDisk.Start(); thdDisk.Start();
} }
@@ -1021,10 +1021,10 @@ namespace osrepodbmgr
buttonOk.Visible = true; buttonOk.Visible = true;
btnEditDisk.Visible = true; btnEditDisk.Visible = true;
btnClearDisks.Visible = true; btnClearDisks.Visible = true;
Core.Core.Failed -= OnDiskAddFailed; Core.Workers.Failed -= OnDiskAddFailed;
Core.Core.Finished -= OnDiskAddFinished; Core.Workers.Finished -= OnDiskAddFinished;
Core.Core.UpdateProgress -= UpdateDiskProgress1; Core.Workers.UpdateProgress -= UpdateDiskProgress1;
Core.Core.UpdateProgress2 -= UpdateDiskProgress2; Core.Workers.UpdateProgress2 -= UpdateDiskProgress2;
Context.workingDisk = null; Context.workingDisk = null;
btnStopAddDisk.Visible = false; btnStopAddDisk.Visible = false;
btnAddDisk.Visible = true; btnAddDisk.Visible = true;
@@ -1134,10 +1134,10 @@ namespace osrepodbmgr
buttonOk.Visible = true; buttonOk.Visible = true;
btnEditDisk.Visible = true; btnEditDisk.Visible = true;
btnClearDisks.Visible = true; btnClearDisks.Visible = true;
Core.Core.Failed -= OnDiskAddFailed; Core.Workers.Failed -= OnDiskAddFailed;
Core.Core.Finished -= OnDiskAddFinished; Core.Workers.Finished -= OnDiskAddFinished;
Core.Core.UpdateProgress -= UpdateDiskProgress1; Core.Workers.UpdateProgress -= UpdateDiskProgress1;
Core.Core.UpdateProgress2 -= UpdateDiskProgress2; Core.Workers.UpdateProgress2 -= UpdateDiskProgress2;
Context.workingDisk = null; Context.workingDisk = null;
btnStopAddDisk.Visible = false; btnStopAddDisk.Visible = false;
btnAddDisk.Visible = true; btnAddDisk.Visible = true;

View File

@@ -55,7 +55,7 @@ public partial class frmAdd : Window
{ {
Build(); Build();
Core.InitDB(); Workers.InitDB();
Context.UnarChangeStatus += UnarChangeStatus; Context.UnarChangeStatus += UnarChangeStatus;
Context.CheckUnar(); Context.CheckUnar();
@@ -183,10 +183,10 @@ public partial class frmAdd : Window
} }
}); });
thdFindFiles = new Thread(Core.FindFiles); thdFindFiles = new Thread(Workers.FindFiles);
Context.path = dlgFolder.Filename; Context.path = dlgFolder.Filename;
Core.Failed += FindFilesFailed; Workers.Failed += FindFilesFailed;
Core.Finished += FindFilesFinished; Workers.Finished += FindFilesFinished;
btnStop.Visible = true; btnStop.Visible = true;
thdPulseProgress.Start(); thdPulseProgress.Start();
thdFindFiles.Start(); thdFindFiles.Start();
@@ -213,8 +213,8 @@ public partial class frmAdd : Window
btnFolder.Visible = true; btnFolder.Visible = true;
btnArchive.Visible = true; btnArchive.Visible = true;
btnSettings.Sensitive = true; btnSettings.Sensitive = true;
Core.Failed -= FindFilesFailed; Workers.Failed -= FindFilesFailed;
Core.Finished -= FindFilesFinished; Workers.Finished -= FindFilesFinished;
thdFindFiles = null; thdFindFiles = null;
}); });
} }
@@ -226,8 +226,8 @@ public partial class frmAdd : Window
if(thdPulseProgress != null) if(thdPulseProgress != null)
thdPulseProgress.Abort(); thdPulseProgress.Abort();
Core.Failed -= FindFilesFailed; Workers.Failed -= FindFilesFailed;
Core.Finished -= FindFilesFinished; Workers.Finished -= FindFilesFinished;
lblProgress.Visible = true; lblProgress.Visible = true;
prgProgress.Visible = true; prgProgress.Visible = true;
@@ -235,11 +235,11 @@ public partial class frmAdd : Window
prgProgress2.Visible = true; prgProgress2.Visible = true;
thdFindFiles = null; thdFindFiles = null;
thdHashFiles = new Thread(Core.HashFiles); thdHashFiles = new Thread(Workers.HashFiles);
Core.Failed += HashFilesFailed; Workers.Failed += HashFilesFailed;
Core.Finished += HashFilesFinished; Workers.Finished += HashFilesFinished;
Core.UpdateProgress += UpdateProgress; Workers.UpdateProgress += UpdateProgress;
Core.UpdateProgress2 += UpdateProgress2; Workers.UpdateProgress2 += UpdateProgress2;
thdHashFiles.Start(); thdHashFiles.Start();
}); });
} }
@@ -260,10 +260,10 @@ public partial class frmAdd : Window
prgProgress.Visible = false; prgProgress.Visible = false;
lblProgress2.Visible = false; lblProgress2.Visible = false;
prgProgress2.Visible = false; prgProgress2.Visible = false;
Core.Failed -= HashFilesFailed; Workers.Failed -= HashFilesFailed;
Core.Finished -= HashFilesFinished; Workers.Finished -= HashFilesFinished;
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
btnExit.Sensitive = true; btnExit.Sensitive = true;
btnFolder.Visible = true; btnFolder.Visible = true;
btnArchive.Visible = true; btnArchive.Visible = true;
@@ -284,21 +284,21 @@ public partial class frmAdd : Window
prgProgress.Visible = false; prgProgress.Visible = false;
lblProgress2.Visible = false; lblProgress2.Visible = false;
prgProgress2.Visible = false; prgProgress2.Visible = false;
Core.Failed -= HashFilesFailed; Workers.Failed -= HashFilesFailed;
Core.Finished -= HashFilesFinished; Workers.Finished -= HashFilesFinished;
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
thdHashFiles = null; thdHashFiles = null;
prgProgress.Visible = true; prgProgress.Visible = true;
thdCheckFiles = new Thread(Core.CheckDbForFiles); thdCheckFiles = new Thread(Workers.CheckDbForFiles);
Core.Failed += ChkFilesFailed; Workers.Failed += ChkFilesFailed;
Core.Finished += ChkFilesFinished; Workers.Finished += ChkFilesFinished;
Core.UpdateProgress += UpdateProgress; Workers.UpdateProgress += UpdateProgress;
Core.UpdateProgress2 += UpdateProgress2; Workers.UpdateProgress2 += UpdateProgress2;
Core.AddFile += AddFile; Workers.AddFile += AddFile;
Core.AddOS += AddOS; Workers.AddOS += AddOS;
btnAdd.Sensitive = false; btnAdd.Sensitive = false;
thdCheckFiles.Start(); thdCheckFiles.Start();
}); });
@@ -322,12 +322,12 @@ public partial class frmAdd : Window
btnStop.Visible = false; btnStop.Visible = false;
btnClose.Visible = false; btnClose.Visible = false;
btnExit.Sensitive = true; btnExit.Sensitive = true;
Core.Failed -= ChkFilesFailed; Workers.Failed -= ChkFilesFailed;
Core.Finished -= ChkFilesFinished; Workers.Finished -= ChkFilesFinished;
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
Core.AddFile -= AddFile; Workers.AddFile -= AddFile;
Core.AddOS -= AddOS; Workers.AddOS -= AddOS;
thdHashFiles = null; thdHashFiles = null;
if(fileView != null) if(fileView != null)
fileView.Clear(); fileView.Clear();
@@ -346,12 +346,12 @@ public partial class frmAdd : Window
if(thdCheckFiles != null) if(thdCheckFiles != null)
thdCheckFiles.Abort(); thdCheckFiles.Abort();
Core.Failed -= ChkFilesFailed; Workers.Failed -= ChkFilesFailed;
Core.Finished -= ChkFilesFinished; Workers.Finished -= ChkFilesFinished;
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
Core.AddFile -= AddFile; Workers.AddFile -= AddFile;
Core.AddOS -= AddOS; Workers.AddOS -= AddOS;
if(thdPulseProgress != null) if(thdPulseProgress != null)
thdPulseProgress.Abort(); thdPulseProgress.Abort();
@@ -530,9 +530,9 @@ public partial class frmAdd : Window
Thread.Sleep(66); Thread.Sleep(66);
} }
}); });
Core.Failed += RemoveTempFilesFailed; Workers.Failed += RemoveTempFilesFailed;
Core.Finished += RemoveTempFilesFinished; Workers.Finished += RemoveTempFilesFinished;
thdRemoveTemp = new Thread(Core.RemoveTempFolder); thdRemoveTemp = new Thread(Workers.RemoveTempFolder);
thdRemoveTemp.Start(); thdRemoveTemp.Start();
} }
@@ -633,9 +633,9 @@ public partial class frmAdd : Window
Thread.Sleep(66); Thread.Sleep(66);
} }
}); });
Core.Failed += RemoveTempFilesFailed; Workers.Failed += RemoveTempFilesFailed;
Core.Finished += RemoveTempFilesFinished; Workers.Finished += RemoveTempFilesFinished;
thdRemoveTemp = new Thread(Core.RemoveTempFolder); thdRemoveTemp = new Thread(Workers.RemoveTempFolder);
thdRemoveTemp.Start(); thdRemoveTemp.Start();
} }
else else
@@ -658,24 +658,24 @@ public partial class frmAdd : Window
btnFolder.Visible = true; btnFolder.Visible = true;
btnArchive.Visible = true; btnArchive.Visible = true;
btnSettings.Sensitive = true; btnSettings.Sensitive = true;
Core.Failed -= FindFilesFailed; Workers.Failed -= FindFilesFailed;
Core.Failed -= HashFilesFailed; Workers.Failed -= HashFilesFailed;
Core.Failed -= ChkFilesFailed; Workers.Failed -= ChkFilesFailed;
Core.Failed -= OpenArchiveFailed; Workers.Failed -= OpenArchiveFailed;
Core.Failed -= AddFilesToDbFailed; Workers.Failed -= AddFilesToDbFailed;
Core.Failed -= PackFilesFailed; Workers.Failed -= PackFilesFailed;
Core.Failed -= ExtractArchiveFailed; Workers.Failed -= ExtractArchiveFailed;
Core.Failed -= RemoveTempFilesFailed; Workers.Failed -= RemoveTempFilesFailed;
Core.Finished -= FindFilesFinished; Workers.Finished -= FindFilesFinished;
Core.Finished -= HashFilesFinished; Workers.Finished -= HashFilesFinished;
Core.Finished -= ChkFilesFinished; Workers.Finished -= ChkFilesFinished;
Core.Finished -= OpenArchiveFinished; Workers.Finished -= OpenArchiveFinished;
Core.Finished -= AddFilesToDbFinished; Workers.Finished -= AddFilesToDbFinished;
Core.Finished -= ExtractArchiveFinished; Workers.Finished -= ExtractArchiveFinished;
Core.Finished -= RemoveTempFilesFinished; Workers.Finished -= RemoveTempFilesFinished;
Core.FinishedWithText -= PackFilesFinished; Workers.FinishedWithText -= PackFilesFinished;
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
btnStop.Visible = false; btnStop.Visible = false;
if(fileView != null) if(fileView != null)
fileView.Clear(); fileView.Clear();
@@ -698,8 +698,8 @@ public partial class frmAdd : Window
thdPulseProgress.Abort(); thdPulseProgress.Abort();
thdPulseProgress = null; thdPulseProgress = null;
} }
Core.Failed -= RemoveTempFilesFailed; Workers.Failed -= RemoveTempFilesFailed;
Core.Finished -= RemoveTempFilesFinished; Workers.Finished -= RemoveTempFilesFinished;
Context.path = null; Context.path = null;
Context.tmpFolder = null; Context.tmpFolder = null;
RestoreUI(); RestoreUI();
@@ -715,8 +715,8 @@ public partial class frmAdd : Window
thdPulseProgress.Abort(); thdPulseProgress.Abort();
thdPulseProgress = null; thdPulseProgress = null;
} }
Core.Failed -= RemoveTempFilesFailed; Workers.Failed -= RemoveTempFilesFailed;
Core.Finished -= RemoveTempFilesFinished; Workers.Finished -= RemoveTempFilesFinished;
Context.path = null; Context.path = null;
Context.tmpFolder = null; Context.tmpFolder = null;
RestoreUI(); RestoreUI();
@@ -744,9 +744,9 @@ public partial class frmAdd : Window
chkNetinstall.Sensitive = false; chkNetinstall.Sensitive = false;
chkSource.Sensitive = false; chkSource.Sensitive = false;
Core.UpdateProgress += UpdateProgress; Workers.UpdateProgress += UpdateProgress;
Core.Finished += AddFilesToDbFinished; Workers.Finished += AddFilesToDbFinished;
Core.Failed += AddFilesToDbFailed; Workers.Failed += AddFilesToDbFailed;
Context.dbInfo.architecture = txtArchitecture.Text; Context.dbInfo.architecture = txtArchitecture.Text;
Context.dbInfo.description = txtDescription.Text; Context.dbInfo.description = txtDescription.Text;
@@ -781,7 +781,7 @@ public partial class frmAdd : Window
Context.dbInfo.json = null; Context.dbInfo.json = null;
} }
thdAddFiles = new Thread(Core.AddFilesToDb); thdAddFiles = new Thread(Workers.AddFilesToDb);
thdAddFiles.Start(); thdAddFiles.Start();
} }
@@ -794,9 +794,9 @@ public partial class frmAdd : Window
if(thdPulseProgress != null) if(thdPulseProgress != null)
thdPulseProgress.Abort(); thdPulseProgress.Abort();
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.Finished -= AddFilesToDbFinished; Workers.Finished -= AddFilesToDbFinished;
Core.Failed -= AddFilesToDbFailed; Workers.Failed -= AddFilesToDbFailed;
long counter = 0; long counter = 0;
fileView.Clear(); fileView.Clear();
@@ -831,9 +831,9 @@ public partial class frmAdd : Window
if(thdPulseProgress != null) if(thdPulseProgress != null)
thdPulseProgress.Abort(); thdPulseProgress.Abort();
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.Finished -= AddFilesToDbFinished; Workers.Finished -= AddFilesToDbFinished;
Core.Failed -= AddFilesToDbFailed; Workers.Failed -= AddFilesToDbFailed;
ChkFilesFinished(); ChkFilesFinished();
}); });
@@ -869,10 +869,10 @@ public partial class frmAdd : Window
chkNetinstall.Sensitive = false; chkNetinstall.Sensitive = false;
chkSource.Sensitive = false; chkSource.Sensitive = false;
Core.UpdateProgress += UpdateProgress; Workers.UpdateProgress += UpdateProgress;
Core.UpdateProgress2 += UpdateProgress2; Workers.UpdateProgress2 += UpdateProgress2;
Core.FinishedWithText += PackFilesFinished; Workers.FinishedWithText += PackFilesFinished;
Core.Failed += PackFilesFailed; Workers.Failed += PackFilesFailed;
Context.dbInfo.architecture = txtArchitecture.Text; Context.dbInfo.architecture = txtArchitecture.Text;
Context.dbInfo.description = txtDescription.Text; Context.dbInfo.description = txtDescription.Text;
@@ -902,17 +902,17 @@ public partial class frmAdd : Window
Thread.Sleep(66); Thread.Sleep(66);
} }
}); });
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
prgProgress.Text = "Copying archive as is."; prgProgress.Text = "Copying archive as is.";
prgProgress2.Visible = false; prgProgress2.Visible = false;
lblProgress2.Visible = false; lblProgress2.Visible = false;
thdPackFiles = new Thread(Core.CopyArchive); thdPackFiles = new Thread(Workers.CopyArchive);
thdPackFiles.Start(); thdPackFiles.Start();
} }
else else
{ {
thdPackFiles = new Thread(Core.CompressFiles); thdPackFiles = new Thread(Workers.CompressFiles);
thdPackFiles.Start(); thdPackFiles.Start();
} }
} }
@@ -926,10 +926,10 @@ public partial class frmAdd : Window
if(thdPulseProgress != null) if(thdPulseProgress != null)
thdPulseProgress.Abort(); thdPulseProgress.Abort();
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
Core.FinishedWithText -= PackFilesFinished; Workers.FinishedWithText -= PackFilesFinished;
Core.Failed -= PackFilesFailed; Workers.Failed -= PackFilesFailed;
btnAdd.Click(); btnAdd.Click();
@@ -955,10 +955,10 @@ public partial class frmAdd : Window
if(thdPulseProgress != null) if(thdPulseProgress != null)
thdPulseProgress.Abort(); thdPulseProgress.Abort();
Core.UpdateProgress -= UpdateProgress; Workers.UpdateProgress -= UpdateProgress;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
Core.FinishedWithText -= PackFilesFinished; Workers.FinishedWithText -= PackFilesFinished;
Core.Failed -= PackFilesFailed; Workers.Failed -= PackFilesFailed;
btnAdd.Sensitive = true; btnAdd.Sensitive = true;
btnPack.Sensitive = true; btnPack.Sensitive = true;
@@ -1020,10 +1020,10 @@ public partial class frmAdd : Window
} }
}); });
thdOpenArchive = new Thread(Core.OpenArchive); thdOpenArchive = new Thread(Workers.OpenArchive);
Context.path = dlgFolder.Filename; Context.path = dlgFolder.Filename;
Core.Failed += OpenArchiveFailed; Workers.Failed += OpenArchiveFailed;
Core.Finished += OpenArchiveFinished; Workers.Finished += OpenArchiveFinished;
btnStop.Visible = true; btnStop.Visible = true;
thdPulseProgress.Start(); thdPulseProgress.Start();
thdOpenArchive.Start(); thdOpenArchive.Start();
@@ -1050,8 +1050,8 @@ public partial class frmAdd : Window
btnFolder.Visible = true; btnFolder.Visible = true;
btnArchive.Visible = true; btnArchive.Visible = true;
btnSettings.Sensitive = true; btnSettings.Sensitive = true;
Core.Failed -= OpenArchiveFailed; Workers.Failed -= OpenArchiveFailed;
Core.Finished -= OpenArchiveFinished; Workers.Finished -= OpenArchiveFinished;
thdOpenArchive = null; thdOpenArchive = null;
}); });
} }
@@ -1082,13 +1082,13 @@ public partial class frmAdd : Window
Thread.Sleep(66); Thread.Sleep(66);
} }
}); });
Core.Failed -= OpenArchiveFailed; Workers.Failed -= OpenArchiveFailed;
Core.Finished -= OpenArchiveFinished; Workers.Finished -= OpenArchiveFinished;
thdOpenArchive = null; thdOpenArchive = null;
Core.Failed += ExtractArchiveFailed; Workers.Failed += ExtractArchiveFailed;
Core.Finished += ExtractArchiveFinished; Workers.Finished += ExtractArchiveFinished;
Core.UpdateProgress2 += UpdateProgress2; Workers.UpdateProgress2 += UpdateProgress2;
thdExtractArchive = new Thread(Core.ExtractArchive); thdExtractArchive = new Thread(Workers.ExtractArchive);
thdExtractArchive.Start(); thdExtractArchive.Start();
}); });
} }
@@ -1111,9 +1111,9 @@ public partial class frmAdd : Window
btnFolder.Visible = true; btnFolder.Visible = true;
btnArchive.Visible = true; btnArchive.Visible = true;
btnSettings.Sensitive = true; btnSettings.Sensitive = true;
Core.Failed -= ExtractArchiveFailed; Workers.Failed -= ExtractArchiveFailed;
Core.Finished -= ExtractArchiveFinished; Workers.Finished -= ExtractArchiveFinished;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
thdExtractArchive = null; thdExtractArchive = null;
if(Context.tmpFolder != null) if(Context.tmpFolder != null)
{ {
@@ -1130,9 +1130,9 @@ public partial class frmAdd : Window
Thread.Sleep(66); Thread.Sleep(66);
} }
}); });
Core.Failed += RemoveTempFilesFailed; Workers.Failed += RemoveTempFilesFailed;
Core.Finished += RemoveTempFilesFinished; Workers.Finished += RemoveTempFilesFinished;
thdRemoveTemp = new Thread(Core.RemoveTempFolder); thdRemoveTemp = new Thread(Workers.RemoveTempFolder);
thdRemoveTemp.Start(); thdRemoveTemp.Start();
} }
}); });
@@ -1154,9 +1154,9 @@ public partial class frmAdd : Window
btnFolder.Visible = false; btnFolder.Visible = false;
btnArchive.Visible = false; btnArchive.Visible = false;
btnSettings.Sensitive = false; btnSettings.Sensitive = false;
Core.Failed -= ExtractArchiveFailed; Workers.Failed -= ExtractArchiveFailed;
Core.Finished -= ExtractArchiveFinished; Workers.Finished -= ExtractArchiveFinished;
Core.UpdateProgress2 -= UpdateProgress2; Workers.UpdateProgress2 -= UpdateProgress2;
thdPulseProgress = new Thread(() => thdPulseProgress = new Thread(() =>
{ {
while(true) while(true)
@@ -1169,9 +1169,9 @@ public partial class frmAdd : Window
} }
}); });
thdFindFiles = new Thread(Core.FindFiles); thdFindFiles = new Thread(Workers.FindFiles);
Core.Failed += FindFilesFailed; Workers.Failed += FindFilesFailed;
Core.Finished += FindFilesFinished; Workers.Finished += FindFilesFinished;
btnStop.Visible = true; btnStop.Visible = true;
thdPulseProgress.Start(); thdPulseProgress.Start();
thdFindFiles.Start(); thdFindFiles.Start();

View File

@@ -63,8 +63,8 @@ namespace osrepodbmgr
Core.Settings.Current.DatabasePath = txtDatabase.Text; Core.Settings.Current.DatabasePath = txtDatabase.Text;
Core.Settings.Current.RepositoryPath = txtRepository.Text; Core.Settings.Current.RepositoryPath = txtRepository.Text;
Core.Settings.SaveSettings(); Core.Settings.SaveSettings();
Core.Core.CloseDB(); Core.Workers.CloseDB();
Core.Core.InitDB(); Core.Workers.InitDB();
Context.CheckUnar(); Context.CheckUnar();
Destroy(); Destroy();
} }
@@ -182,12 +182,12 @@ namespace osrepodbmgr
void CheckUnar() void CheckUnar()
{ {
Core.Core.FinishedWithText += CheckUnarFinished; Core.Workers.FinishedWithText += CheckUnarFinished;
Core.Core.Failed += CheckUnarFailed; Core.Workers.Failed += CheckUnarFailed;
oldUnarPath = Core.Settings.Current.UnArchiverPath; oldUnarPath = Core.Settings.Current.UnArchiverPath;
Core.Settings.Current.UnArchiverPath = txtUnar.Text; Core.Settings.Current.UnArchiverPath = txtUnar.Text;
Thread thdCheckUnar = new Thread(Core.Core.CheckUnar); Thread thdCheckUnar = new Thread(Core.Workers.CheckUnar);
thdCheckUnar.Start(); thdCheckUnar.Start();
} }
@@ -195,8 +195,8 @@ namespace osrepodbmgr
{ {
Application.Invoke(delegate Application.Invoke(delegate
{ {
Core.Core.FinishedWithText -= CheckUnarFinished; Core.Workers.FinishedWithText -= CheckUnarFinished;
Core.Core.Failed -= CheckUnarFailed; Core.Workers.Failed -= CheckUnarFailed;
lblUnarVersion.Text = text; lblUnarVersion.Text = text;
lblUnarVersion.Visible = true; lblUnarVersion.Visible = true;
@@ -208,8 +208,8 @@ namespace osrepodbmgr
{ {
Application.Invoke(delegate Application.Invoke(delegate
{ {
Core.Core.FinishedWithText -= CheckUnarFinished; Core.Workers.FinishedWithText -= CheckUnarFinished;
Core.Core.Failed -= CheckUnarFailed; Core.Workers.Failed -= CheckUnarFailed;
if(string.IsNullOrWhiteSpace(oldUnarPath)) if(string.IsNullOrWhiteSpace(oldUnarPath))
txtUnar.Text = ""; txtUnar.Text = "";