Exemple #1
0
        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);
        }
Exemple #2
0
        private void Accept()
        {
            if (string.IsNullOrEmpty(txtUri.Text) || string.IsNullOrEmpty(txtLogin.Text) ||
                string.IsNullOrEmpty(txtPassword.Text) || string.IsNullOrEmpty(txtDomain.Text))
            {
                MessageBox.Show("Missing required information");
                return;
            }

            try
            {
                Uri tfsUri = new Uri(txtUri.Text);
                connect = new Connect(tfsUri, txtLogin.Text, txtPassword.Text, txtDomain.Text);

                if (connect != null)
                {
                    TFSRegistry.SetUri(txtUri.Text);
                    TFSRegistry.SetLogin(StringCipher.Encrypt(txtLogin.Text, cipherPassphrase));
                    TFSRegistry.SetPassword(StringCipher.Encrypt(txtPassword.Text, cipherPassphrase));
                    TFSRegistry.SetDomain(txtDomain.Text);
                    StaticUtils.connect = connect;
                    this.DialogResult   = DialogResult.OK;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }
Exemple #3
0
        private void saveStoryFlowToExcelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (StaticUtil.CurrentFuzzFile == null)
            {
                MessageBox.Show("You must dump data first");
                return;
            }

            Cursor = Cursors.WaitCursor;
            var ds = VSCommon.LoadDumpDataset(TFSRegistry.GetTFSMdbPath());

            var saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter = "xls files (*.xlsx)|*.xlsx|All files (*.*)|*.*";
            saveFileDialog1.Title  = "To Excel";

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                var fileName = saveFileDialog1.FileName;
                UserStoryCumulativeFlow.BuildStoryFlowDump(ds, fileName);
                Cursor = Cursors.Default;

                Process.Start(fileName);
            }
        }
Exemple #4
0
        public frmLogin()
        {
            InitializeComponent();

            txtUri.Text      = TFSRegistry.GetUri();
            txtLogin.Text    = StringCipher.Decrypt(TFSRegistry.GetLogin(), cipherPassphrase);
            txtPassword.Text = StringCipher.Decrypt(TFSRegistry.GetPassword(), cipherPassphrase);
            txtDomain.Text   = TFSRegistry.GetDomain();
        }
Exemple #5
0
        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();
            }
        }
Exemple #6
0
        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();
            }
        }
Exemple #7
0
        private void CheckForTFSMdbFile()
        {
            if (string.IsNullOrWhiteSpace(tfsPath))
            {
                if (CanWorkLocally())
                {
                    AskToUpdateTFSFile(@"c:\TFSUtility\tfs.accdb");
                }
                else
                {
                    tfsPath = GetUserSelectedTFSFilePath();
                    if (!string.IsNullOrWhiteSpace(tfsPath))
                    {
                        TFSRegistry.SetTFSMdbPath(tfsPath);
                    }
                }
            }

            AskToUpdateTFSFile(TFSRegistry.GetTFSMdbPath());
        }
Exemple #8
0
        private bool CanWorkLocally()
        {
            bool ret = false;

            try
            {
                if (Directory.Exists(@"c:\TFSUtility") == false)
                {
                    Directory.CreateDirectory(@"c:\TFSUtility");
                }
                TFSRegistry.SetTFSMdbPath(@"c:\TFSUtility\TFS.mdb");
                ret = true;
            }
            catch
            {
                ret = false;
            }

            return(ret);
        }
        public void canSerializeDeserialzeTFSStateManagerByProjNameTeamNameAreaId()
        {
            var sm = new TFSStateManager();

            sm.ProjectName = "Serialize Test";
            sm.TeamName    = "Team Test";
            sm.AreaId      = 67;

            sm.AddState("Cat1", "Backlog", "New", true, false);
            sm.AddState("Cat1", "Backlog", "New", false, true);
            sm.AddState("Cat1", "Story Authoring", "New", true, false);
            sm.AddState("Cat1", "Story Authoring", "New", false, true);
            sm.AddState("Cat2", "Ready for Dev", "New", true, false);
            sm.AddState("Cat2", "Ready for Dev", "New", false, true);
            sm.AddState("Development", "Development", "Active", true, false);
            sm.AddState("DevelopmentDone", "Development", "Active", false, true, true);


            TFSStateManager.SaveFuzzFile(Path.GetDirectoryName(TFSRegistry.GetTFSMdbPath()), sm);


            var FuzzFiles = TFSStateManager.LoadFuzzFiles(Path.GetDirectoryName(TFSRegistry.GetTFSMdbPath()));
        }
Exemple #10
0
        private void PopulateProjectAreasAndSetDefault()
        {
            cboRealProject.DataSource    = connect.GetTfsProjects();
            cboRealProject.DisplayMember = "Name";
            cboRealProject.ValueMember   = "Id";

            string defaultProjectName = TFSRegistry.GetDefaultProjectName("Marketing Temp");
            var    proj = connect.GetProject(defaultProjectName);

            cboRealProject.SelectedValue = proj.Id;

            var teams = UpdateTeams(proj);

            if (teams.Any(x => x.Name == TFSRegistry.GetDefaultTeamName("Wegmans Mobile App")))
            {
                cboTeam.SelectedValue =
                    teams.First(x => x.Name == TFSRegistry.GetDefaultTeamName("Wegmans Mobile App")).Identity;
            }

            txtIterationPath.Text = TFSRegistry.GetIterationPath(@"Marketing Temp\Asynchrony");

            UpdateTeamAreas();
        }
Exemple #11
0
 private void SaveFeatureOptions()
 {
     TFSRegistry.SetRegistryKey("DevMetrics_FeatureSearch", txtFeatures.Text);
 }
Exemple #12
0
 private void GetFeatureOptions()
 {
     txtFeatures.Text = TFSRegistry.GetRegistryKey("DevMetrics_FeatureSearch");
 }
        public void testCreateManualFileForWMA()
        {
            var sm = new TFSStateManager();

            sm.ProjectUri  = "https://wegmans.visualstudio.com/";
            sm.ProjectName = "MARKETING TEMP";
            sm.TeamName    = "Wegmans Mobile App";
            sm.AreaId      = 2884;


            //cat, kanban col, sys state
            sm.AddState("Backlog", "New", "New", false, true);
            sm.AddState("Backlog", "New", "New", true, false);
            sm.AddState("Backlog", "Backlog", "New", false, true);
            sm.AddState("Backlog", "Backlog", "New", true, false);
            sm.AddState("Backlog", "Story Authoring", "New", false, true);
            sm.AddState("Backlog", "Story Authoring", "New", true, false);
            sm.AddState("Backlog", "Ready For Dev", "New", false, true);
            sm.AddState("Backlog", "Ready For Dev", "New", true, false);

            sm.AddState("Development", "Active", "Active", true, false);
            sm.AddState("Development", "Active", "Active", false, true);
            sm.AddState("Development", "Development", "Active", true, false);
            sm.AddState("DevelopmentDone", "Development", "Active", false, true, true); //dev done

            sm.AddState("AsynchronyQA", "Asynchrony QA", "Active", true, false);
            sm.AddState("AsynchronyQADone", "Asynchrony QA", "Active", false, true, false, true); //qa done

            sm.AddState("WegmansQA", "Wegmans QA", "Active", true, false);
            sm.AddState("WegmansQADone", "Wegmans QA", "Active", false, true, false, false, true); //uat done

            sm.AddState("POReview", "PO Review", "Resolved", true, false);
            sm.AddState("POReviewDone", "PO Review", "Resolved", false, true);

            sm.AddState("Smoketest", "Alpha Channel Smoke Test", "Resolved", true, false);
            sm.AddState("SmoketestDone", "Alpha Channel Smoke Test", "Resolved", false, true);

            sm.AddState("Closed", "Closed", "Closed", false, true);
            sm.AddState("Closed", "Closed", "Closed", true, false);

            TFSStateManager.SaveFuzzFile(Path.GetDirectoryName(TFSRegistry.GetTFSMdbPath()), sm);


            //------------------------------------------------------------------
            sm = new TFSStateManager();

            sm.ProjectUri  = "https://wegmans.visualstudio.com/";
            sm.ProjectName = "MARKETING TEMP";
            sm.TeamName    = "DevCXOne";
            sm.AreaId      = 405;


            //cat, kanban col, sys state
            sm.AddState("Backlog", "New", "New", false, true);
            sm.AddState("Backlog", "New", "New", true, false);
            sm.AddState("Backlog", "Backlog", "New", false, true);
            sm.AddState("Backlog", "Backlog", "New", true, false);
            sm.AddState("Backlog", "Story Authoring", "New", false, true);
            sm.AddState("Backlog", "Story Authoring", "New", true, false);
            sm.AddState("Backlog", "Ready for grooming", "New", false, true);
            sm.AddState("Backlog", "Ready for grooming", "New", true, false);
            sm.AddState("Backlog", "Ready For Development", "Active", false, true);
            sm.AddState("Backlog", "Ready For Devdevelopment", "Active", true, false);

            sm.AddState("Development", "Active", "Active", true, false);
            sm.AddState("Development", "Active", "Active", false, true);
            sm.AddState("Development", "Development", "Active", true, false);
            sm.AddState("DevelopmentDone", "Development", "Active", false, true, true); //dev done

            sm.AddState("PeerReview", "Peer Review", "Active", true, false);
            sm.AddState("PeerReviewDone", "Peer Review Done", "Active", false, true);

            sm.AddState("ReadyQA", "Ready for QA", "Active", true, false);
            sm.AddState("ReadyQA", "Ready for QA", "Active", false, true);

            sm.AddState("QA", "Quality Assurance", "Active", true, false);
            sm.AddState("QADone", "Quality Assurance", "Active", false, true);//qa done

            sm.AddState("ReadyForProduction", "Ready for production", "Resolved", true, false);
            sm.AddState("ReadyForProduction", "Ready for production", "Resolved", false, true);

            sm.AddState("Closed", "Closed", "Closed", false, true);
            sm.AddState("Closed", "Closed", "Closed", true, false);

            sm.AddState("Closed", "Done", "Closed", false, true);
            sm.AddState("Closed", "Done", "Closed", true, false);

            TFSStateManager.SaveFuzzFile(Path.GetDirectoryName(TFSRegistry.GetTFSMdbPath()), sm);
        }