public void DoRefresh(int currentCategoryId) { if (this.threadExecute != null) { this.threadExecute.Dispose(); } this.currentCategoryId = currentCategoryId; //Package the class' method entry point up in a delegate ThreadExecuteTask.ExecuteMeOnAnotherThread delegateCallCode; delegateCallCode = new ThreadExecuteTask.ExecuteMeOnAnotherThread(this.Refresh); //Tell the thread to get going! this.threadExecute = new ThreadExecuteTask(delegateCallCode); }
private void prepareNextGx(int minutes) { this.nextMinute = minutes; if (this.threadExecute != null) { this.threadExecute.Dispose(); } //Package the class' method entry point up in a delegate ThreadExecuteTask.ExecuteMeOnAnotherThread delegateCallCode; delegateCallCode = new ThreadExecuteTask.ExecuteMeOnAnotherThread(this.prepareGxAsync); //Tell the thread to get going! this.threadExecute = new ThreadExecuteTask(delegateCallCode); }
public void Load(bool sync, int pageNumber) { if (this.lastLoadedPage != pageNumber) { firstRecordindex = pageNumber * this.countPerPage; if (sync) { LoadData(null); } else { //Package the class' method entry point up in a delegate ThreadExecuteTask.ExecuteMeOnAnotherThread delegateCallCode; delegateCallCode = new ThreadExecuteTask.ExecuteMeOnAnotherThread(this.LoadData); //Tell the thread to get going! threadExecute = new ThreadExecuteTask(delegateCallCode); } this.lastLoadedPage = pageNumber; } }