/// <summary> /// up/download all your files to dropbox automatically (Async) /// </summary> public static void filesyncAsync() { //Testing Connection BackgroundWorker bwSync = new BackgroundWorker(); if (!LauncherHelper.TestConnection()) return; if (String.IsNullOrEmpty(Properties.Settings.Default.DropBoxUserToken)) { MessageBox.Show("bind your account first"); } else { bwSync.DoWork += new DoWorkEventHandler(bwSync_DoWork); bwSync.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwSync_RunWorkerCompleted); bwSync.RunWorkerAsync(); NotifyBox note = new NotifyBox(); note.setMsg("Sync start"); note.Show(); } }
/// <summary> /// Will be fired when everythin is syncronized /// </summary> /// <param name="sender"></param> /// <param name="e">e.Result shows a short, or with stacktrace in dbgmode, statusmessage </param> static void bwSync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { NotifyBox note = new NotifyBox(); note.setMsg("Sync end"); note.Show(); }