-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
579 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace DataTableConverter.Assisstant | ||
{ | ||
class ThreadHelper | ||
{ | ||
private List<Thread> Threads = new List<Thread>(); | ||
private readonly Action Start, End; | ||
internal bool Abort; | ||
internal static ThreadAction Threadaction; | ||
|
||
internal ThreadHelper(Action start, Action end) | ||
{ | ||
Start = start; | ||
End = end; | ||
} | ||
|
||
internal void StartThread(ThreadAction action) | ||
{ | ||
Thread thread = new Thread(() => | ||
{ | ||
try | ||
{ | ||
Start(); | ||
Thread.CurrentThread.IsBackground = true; | ||
|
||
action(ref Abort); | ||
} | ||
catch (Exception ex) | ||
{ | ||
ErrorHelper.LogMessage(ex); | ||
} | ||
finally | ||
{ | ||
End(); | ||
Threads.Remove(Thread.CurrentThread); | ||
} | ||
}); | ||
Threads.Add(thread); | ||
thread.Start(); | ||
} | ||
|
||
internal delegate void ThreadAction(ref bool abort); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace DataTableConverter.Classes | ||
{ | ||
class DataRowArray | ||
{ | ||
internal List<List<string>> Values; | ||
internal DataRow DataRow; | ||
|
||
internal DataRowArray(DataRow dataRow, List<string> values) | ||
{ | ||
Values = new List<List<string>> | ||
{ | ||
values | ||
}; | ||
DataRow = dataRow; | ||
} | ||
|
||
internal void Add(List<string> values) | ||
{ | ||
Values.Add(values); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.