protected void _work() { if (Work != null) { WorkEventArgs e = new WorkEventArgs(this.Status, this._userID, this._userList); Work(this, e); Status = e.status; } }
public void Run() { lock (this) { if (Status == WorkThreadStatus.Stop) { Status = WorkThreadStatus.Starting; System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(_work)); //thread.Name = "work"; thread.Start(); } } }
public WorkEventArgs(WorkThreadStatus status, int userId, List <Pair> userList) { this.status = status; this.userId = userId; this.userList = userList; }