Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
 private void tt_onProgress(object sender, HDCallBackEventArgs e)
 {
     if (this.onProgress != null)
     {
         this.onProgress(this, e);
     }
 }
Exemplo n.º 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));
         }
     });
 }
Exemplo n.º 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);
         }
     });
 }
Exemplo n.º 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));
         }
     }
 }
Exemplo n.º 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();
         }
     });
 }
Exemplo n.º 7
0
 void logoutTask_onComplete(object sender, HDCallBackEventArgs e)
 {
     this.callBack(e);
 }
Exemplo n.º 8
0
 private void eb_onComplete(object sender, HDCallBackEventArgs e)
 {
     this.callBack(e);
     this.callBack = null;
 }