/// <summary> /// Task tracker call back /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tt_onComplete(object sender, HDCallBackEventArgs e) { if (null != this.AsyncHanlder) { this.AsyncHanlder(this, e); } }
private void tt_onProgress(object sender, HDCallBackEventArgs e) { if (this.onProgress != null) { this.onProgress(this, e); } }
private void Logout_Handle(HDCallBackEventArgs e) { this.Dispatcher.BeginInvoke(delegate() { if (this.LogoutRequest != null) { Globals.IsLoggedIn = false; this.LogoutRequest(this, new NavigateRequestArgs(PageEnum.LoginPage, null)); } }); }
/// <summary> /// Progress update /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mp_onProgress(object sender, HDCallBackEventArgs e) { this.Dispatcher.BeginInvoke(delegate() { if (e != null) { TaskProgress tp = e.Result as TaskProgress; this.UpdateProgress(tp.percentage, tp.TaskDescription); } }); }
/// <summary> /// One task is complete /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Task_onComplete(object sender, HDCallBackEventArgs e) { if (e.Error != null) { this.onComplete(this, e); } else { int nextId = (int)e.tag + 1; if (nextId < this.totalTasksNum) { if (this.onProgress != null) { this.onProgress(this, new HDCallBackEventArgs(nextId, new TaskProgress(taskList[nextId].TaskDescription, this.GetPercentage(nextId)))); } taskList[nextId].StartAsync(this.param, nextId); } else { // this.onComplete(this, new TaskArgs(TaskArgsStatus.SUCCESS, null, 0)); this.onComplete(this, new HDCallBackEventArgs(0, null)); } } }
/// <summary> /// Get the result now /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mp_AsyncHanlder(object sender, HDCallBackEventArgs e) { this.Dispatcher.BeginInvoke(delegate() { if (e.Error == null) { Globals.IsLoggedIn = true; ConfigurationSettings.LastUserName = ModelProvider.Instance.UserId; this.NavigationService.Navigate(new Uri("/WorkSpace", UriKind.Relative)); } else { // For any error during init, we call logout if (Globals.IsLoggedIn) { //ModelProvider.Instance.Logout(); } Globals.IsLoggedIn = false; this.UpdateProgress(101, e.Error.Message); // Input an invalid percentage on purpose btnOK.Visibility = Visibility.Visible; btnOK.Focus(); } }); }
void logoutTask_onComplete(object sender, HDCallBackEventArgs e) { this.callBack(e); }
private void eb_onComplete(object sender, HDCallBackEventArgs e) { this.callBack(e); this.callBack = null; }