private void btnCopyTestItems_Click(object sender, EventArgs e)
        {
            string results = string.Empty;

            List <TreeNode> checkedPlanNodes = ValidateFormAndReturnSelectedTestPlanNodes();

            if (checkedPlanNodes == null)
            {
                return;
            }

            int testPlanIndex = 1;

            foreach (TreeNode planNode in checkedPlanNodes)
            {
                myStatus.Text = string.Format("Processing Test Plan '{0}' ({1}/{2})", planNode.Text, testPlanIndex, checkedPlanNodes.Count);
                this.Refresh();

                results += TfsOperations.CopyTestPlan(_destinationTestManagementTeamProject, planNode.Tag as ITestPlan);

                testPlanIndex++;
            }

            #endregion

            ResultsForm resultsForm = new ResultsForm(results);
            resultsForm.Show();

            myStatus.Text = string.Empty;
            MessageBox.Show("Finished...", "Finished");
        }
        private void btnSelectDestinationTfsProject_Click(object sender, EventArgs e)
        {
            _destinationTestManagementTeamProject = TfsOperations.SelectTfsProject(true);

            if (_destinationTestManagementTeamProject != null)
            {
                lblDestinationTfsProject.Text = _destinationTestManagementTeamProject.ToString();
            }
        }
        private void btnSelectSourceTfsProject_Click(object sender, EventArgs e)
        {
            _sourceTestManagementTeamProject = TfsOperations.SelectTfsProject(false);

            if (_sourceTestManagementTeamProject != null)
            {
                lblSourceTfsProject.Text = _sourceTestManagementTeamProject.ToString();

                treeTestPlans.Nodes.Clear();

                this.Refresh();
                LoadTestPlansToForm(treeTestPlans);

                myStatus.Text = string.Empty;
            }
        }
        /// <summary>
        /// Loads the test plans for the selected Source TFS project to the treeView control.
        /// </summary>
        /// <param name="treeView">The tree view.</param>
        private void LoadTestPlansToForm(TreeView treeView)
        {
            ITestPlanCollection sourceTestPlans = TfsOperations.GetTestPlansForTfsProject(_sourceTestManagementTeamProject);

            int planIndex = 1;

            foreach (ITestPlan plan in sourceTestPlans)
            {
                myStatus.Text = string.Format("Loading Test Plan '{0}' ({1}/{2})", plan.Name, planIndex, sourceTestPlans.Count);
                this.Refresh();

                TreeNode planNode = new TreeNode(plan.Name, 1, 1);
                planNode.Tag = plan;

                treeView.Nodes.Add(planNode);

                planIndex++;
            }

            myStatus.Text = string.Empty;
        }