- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
public static Thread RunInNewThread(Action<string[]> method, string[] args, ThreadPriority priority)
{
Thread thread = new Thread(() => method(args));
thread.Name = method.Method.Name;
thread.SetApartmentState(ApartmentState.STA);
thread.Priority = priority;
thread.Start();
return thread;
}
public static Thread RunInNewThread(Action<bool> method, bool args, ThreadPriority priority)
{
Thread thread = new Thread(() => method(args));
thread.Name = method.Method.Name;
thread.SetApartmentState(ApartmentState.STA);
thread.Priority = priority;
thread.Start();
return thread;
}
public static Thread RunInNewThread(Action<DateTime> method, DateTime date, ThreadPriority priority)
{
Thread thread = new Thread(() => method(date));
thread.Name = method.Method.Name;
thread.SetApartmentState(ApartmentState.STA);
thread.Priority = priority;
thread.Start();
return thread;
}
Комментарии (0) RSS
Добавить комментарий