Пример #1
0
 /// <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);
     }
 }
Пример #2
0
 private void tt_onProgress(object sender, HDCallBackEventArgs e)
 {
     if (this.onProgress != null)
     {
         this.onProgress(this, e);
     }
 }
Пример #3
0
 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));
         }
     });
 }
Пример #4
0
 /// <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);
         }
     });
 }
Пример #5
0
 /// <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));
         }
     }
 }
Пример #6
0
 /// <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();
         }
     });
 }
Пример #7
0
 void logoutTask_onComplete(object sender, HDCallBackEventArgs e)
 {
     this.callBack(e);
 }
Пример #8
0
 private void eb_onComplete(object sender, HDCallBackEventArgs e)
 {
     this.callBack(e);
     this.callBack = null;
 }