private void BtnSaveNewTree_Click(object sender, EventArgs e) { treeNew.SaveTreeFromTreeViewControlByParent(); // abort the background saving that was triggered by SaveTreeFromTreeViewControlByParent // locks a concurrent modification of Commons.BackgroundCanStillSaveTopicsTree lock (Commons.LockBackgroundCanStillSaveTopicsTree) { Commons.BackgroundCanStillSaveTopicsTree = false; } // we wait for the saving Thread to finish // (it aborts in a point in which status is preserved) Commons.BackgroundSaveThread.Join(30000); // enormous timeout just for big problems MessageBox.Show("Fatto"); }
private void BtnSaveNewTree_Click(object sender, EventArgs e) { treeNew.SaveTreeFromTreeViewControlByParent(); // abort the background saving that was triggered by SaveTreeFromTreeViewControlByParent // locks a concurrent modification of Commons.BackgroundCanStillSaveTopicsTree lock (CommonsWinForms.LockBackgroundSavingVariables) { CommonsWinForms.BackgroundSavingEnabled = false; CommonsWinForms.BackgroundTaskClose = true; } // we wait for the saving Thread to finish // (it aborts in a point in which status is preserved) CommonsWinForms.BackgroundSaveThread.Join(3000); // !!!! TODO restart the task on closing the form !!!! MessageBox.Show("Fatto"); }
private void BtnSaveNewTree_Click(object sender, EventArgs e) { treeNew.SaveTreeFromTreeViewControlByParent(); MessageBox.Show("Fatto"); }