Exemplo n.º 1
0
 private void frmMain_Shown(object sender, EventArgs e)
 {
     try
     {
         Jobs.Log("frmMain Shown", null);
         Thread thread = new Thread(new ThreadStart(appStartup));
         thread.Start();
         Jobs.Log("AppStartupThread(Waiting) Started", null);
         WaitingDialog.showWaitingDialog(this, "Starting up...", "", false);
     }
     catch (Exception ex)
     {
         Jobs.Log("Error[frmMainShown]", ex);
     }
 }
Exemplo n.º 2
0
 private void threadLoadLoans(object searchFor)
 {
     try
     {
         Action act = () => { lvLoans.Items.Clear(); };
         Invoke(act);
         Jobs.Log("Scanning Loans and Adding in LoanList", null);
         Jobs.scanLoans(addLoanToLV, searchFor.ToString());
         act = () => { WaitingDialog.closeNow(); };
         Invoke(act);
     }
     catch (Exception ex)
     {
         Jobs.Log("Error[threadLoanLoans]", ex);
     }
 }
Exemplo n.º 3
0
 private void loadLoans(String searchFor)
 {
     try
     {
         Jobs.Log("LoadLoans Called", null);
         Thread thLoadLoans = new Thread(new ParameterizedThreadStart(threadLoadLoans));
         thLoadLoans.Name     = "Thread: LoadLoans";
         thLoadLoans.Priority = ThreadPriority.Highest;
         thLoadLoans.Start(searchFor);
         Jobs.Log("[loadLoans] Calling Thread", null);
         WaitingDialog.showWaitingDialog(this, "Scanning loans...", "", true);
     }
     catch (Exception ex)
     {
         Jobs.Log("Error[loadLoans]", ex);
     }
 }
Exemplo n.º 4
0
 public static void showWaitingDialog(IWin32Window form, String title, String message, bool isProgressManaged)
 {
     if (wd == null)
     {
         wd = new WaitingDialog(title, message, isProgressManaged);
     }
     wd.lblTitle.Text     = title;
     wd.lblMessage.Text   = message;
     wd.isProgressManaged = isProgressManaged;
     if (isProgressManaged)
     {
         wd.pb.Style = ProgressBarStyle.Continuous;
     }
     if (form != null && !wd.Visible)
     {
         wd.ShowDialog(form);
     }
     else
     {
         wd.Show();
     }
 }
Exemplo n.º 5
0
 private void appStartup()
 {
     try
     {
         Jobs.Log("appStartup Called", null);
         Action act = null;
         if (!Jobs.isDatabaseExists())
         {
             act = () => { WaitingDialog.getMessageLabel().Text = "Initiating database..."; };
             Invoke(act);
             Jobs.Log("New Database Initilized", null);
         }
         Jobs.initiateDatabaseConnection();
         act = () =>
         {
             loadLoans();
         };
         Invoke(act);
     }
     catch (Exception ex)
     {
         Jobs.Log("Error[appStartup]", ex);
     }
 }
Exemplo n.º 6
0
 private void WaitingDialog_FormClosed(object sender, FormClosedEventArgs e)
 {
     wd = null;
 }