private bool DumpTFS() { if (VSCommon.IsFileLocked(TFSRegistry.GetTFSMdbPath())) { MessageBox.Show("Cannot update data from TFS because the TFS.accdb file is open on your machine. Please close it, then try again."); return(false); } string path = TFSRegistry.GetTFSMdbPath(); button1.Enabled = false; Cursor = Cursors.WaitCursor; Application.DoEvents(); var wait = new InfoFrm("Extracting data from TFS, please wait ...", false); wait.Show(this); Application.DoEvents(); DumpWorkItemsToDS dump = new DumpWorkItemsToDS(connect, SelectedAreaId, wait, "Marketing Temp", TFSRegistry.LastDayOfWeek, txtIterationPath.Text.Trim(), chkIterationPath_Under.Checked, chkIterationPath_Equals.Checked); dump.DumpWorkItems(path); wait.Close(); button1.Enabled = true; Cursor = Cursors.Default; Application.DoEvents(); return(true); }
private void button1_Click(object sender, EventArgs e) { if (!FuzzFileValid) { return; } if (!initialized) { init(); initialized = true; } TFSRegistry.SetDefaultIterationPath(txtIterationPath.Text.Trim()); if (chkIterationPath_Under.Checked || chkIterationPath_Equals.Checked) { if (string.IsNullOrWhiteSpace(txtIterationPath.Text)) { MessageBox.Show( "You must enter a valid iteration path if either of the Iteration Path checkboxes are checked."); return; } } string message = string.Format("This application will automatically update the 'TFS dump' file if it is more than 4 hours old?{0}{0}Would you like to update the file anyway?", Environment.NewLine); if (MessageBox.Show(message, "TFS", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { if (VSCommon.IsFileLocked(TFSRegistry.GetTFSMdbPath())) { MessageBox.Show("Cannot update data from TFS because the TFS.mdb file is open on your machine. Please close it, then try again."); return; } string path = TFSRegistry.GetTFSMdbPath(); Cursor = Cursors.WaitCursor; button1.Enabled = false; Application.DoEvents(); var wait = new InfoFrm("Extracting data, please wait ...", false); wait.Show(this); Application.DoEvents(); DumpWorkItemsToDS dump = new DumpWorkItemsToDS(connect, SelectedAreaId, wait, SelectedProject.Name, TFSRegistry.LastDayOfWeek, txtIterationPath.Text.Trim(), chkIterationPath_Under.Checked, chkIterationPath_Equals.Checked); dump.DumpWorkItems(path); wait.Close(); button1.Enabled = true; Cursor = Cursors.Default; Application.DoEvents(); } }