private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.textBox1.Text)) { MessageBox.Show("No path provided for backup files"); return; } try { this.controller = new DropboxController(); this.model = controller.Get(); model.FolderUpdatedEvent += model_FolderUpdatedEvent; model.UpdateProgressEvent += model_UpdateProgressEvent; model.UpdateNameEvent += model_UpdateNameEvent; } catch { MessageBox.Show("Unable to initiate model, see log for more details"); } this.buttonBackup.Enabled = false; this.buttonOpenFolder.Enabled = false; this.buttonCancel.Enabled = true; this.textBox1.Enabled = false; this.labelNameValue.Text = string.Empty; this.backgroundWorker1.RunWorkerAsync(); this.labelCountDownload.Text = string.Empty; }
public DropboxModel Get() { this.model = new DropboxModel(); return model; }
internal static DropboxModel Get() { if (model == null) { model = new DropboxModel(); } return model; }