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(); } }
private void dynamicChartToolStripMenuItem_Click(object sender, EventArgs e) { if (!FuzzFileValid) { return; } if (!initialized) { init(); initialized = true; } //get the last update date from the file if (File.Exists(TFSRegistry.GetTFSMdbPath()) && VSCommon.GetDumpFileAreaId(TFSRegistry.GetTFSMdbPath()) == SelectedAreaId) { DateTime?dumpDate = VSCommon.GetDumpDate(TFSRegistry.GetTFSMdbPath()); if (DateTime.Now.Subtract(dumpDate.Value).TotalHours >= 4) { if (MessageBox.Show("The data used by this application hasn't been updated since " + dumpDate.Value.ToString() + Environment.NewLine + "Would you like to update now?", "Update Ira Dump Data", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (DumpTFS() == false) { return; } } } } else { if (DumpTFS() == false) { return; } } if (File.Exists(TFSRegistry.GetTFSMdbPath())) { 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; } var f = new frmDynamicChart(TFSRegistry.GetTFSMdbPath(), connect, SelectedAreaId, cboTeam.Text); f.Show(); } }