private void InitializeThreadState(object threadParams, ThreadWorkerMethod workerMethod, ApartmentState aptState, bool background) { this.threadParams = threadParams; this.threadWorkerMethod = workerMethod; this.thread = new Thread(new ThreadStart(this.ThreadEntryPoint)); this.thread.SetApartmentState(aptState); this.backgroundThread = background; }
private ThreadDispatch() { this.thread = null; this.exception = null; this.threadParams = null; this.threadWorkerMethodWithReturn = null; this.threadWorkerMethodWithReturnAndParam = null; this.threadWorkerMethod = null; this.threadWorkerMethodWithParam = null; this.threadReturn = null; this.backgroundThread = false; this.apartmentType = ApartmentState.MTA; }
/// <summary> /// Constructs a ThreadDispatch object with the thread worker method. /// Default settings on the ThreadDispatch object are: /// 1. Parameter is null /// 2. Thread ApartmentState will be MTA /// 3. Background thread status will be false /// </summary> /// <param name="workerMethod">Delegate to be called to perform the work</param> public ThreadDispatch ( ThreadWorkerMethod workerMethod ) : this ( ) { InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ) ; }
public ThreadDispatch(ThreadWorkerMethod workerMethod) : this() { this.InitializeThreadState(null, workerMethod, ApartmentState.MTA, false); }