Example #1
0
        private void ConnectDestinationProjectButton_Click(object sender, RoutedEventArgs e)
        {
            TeamProjectPicker tpp    = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
            DialogResult      result = tpp.ShowDialog();

            if (result.ToString() == "OK")
            {
                StatusViwer.Content          = "";
                MigratingLabel.Content       = "";
                StatusBar.Value              = 0;
                SourceFieldGrid.ItemsSource  = new List <string>();
                TargetFieldGrid.ItemsSource  = new List <string>();
                MappedListGrid.ItemsSource   = new List <object>();
                FieldToCopyGrid.ItemsSource  = new List <object>();
                WorkFlowListGrid.ItemsSource = new List <object>();
                finalFieldMap   = new Hashtable();
                copyingFieldSet = new Hashtable();
                migrateTypeSet  = new List <object>();

                this.destinationTFS   = tpp.SelectedTeamProjectCollection;
                this.destinationStore = (WorkItemStore)destinationTFS.GetService(typeof(WorkItemStore));

                this.destinationProject     = destinationStore.Projects[tpp.SelectedProjects[0].Name];
                DestinationProjectText.Text = string.Format("{0}/{1}", destinationTFS.Uri.ToString(), destinationProject.Name);
                writeTarget = new WorkItemWrite(destinationTFS, destinationProject);

                if ((string)ConnectionStatusLabel.Content == "Select a Target project")
                {
                    ConnectionStatusLabel.Content = "";
                }
            }
        }
        private void ConnectDestinationProjectButton_Click(object sender, RoutedEventArgs e)
        {
            TeamProjectPicker tpp    = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
            DialogResult      result = tpp.ShowDialog();

            if (result.ToString() == "OK")
            {
                StatusViwer.Content          = "";
                MigratingLabel.Content       = "";
                StatusBar.Value              = 0;
                SourceFieldGrid.ItemsSource  = new List <string>();
                TargetFieldGrid.ItemsSource  = new List <string>();
                MappedListGrid.ItemsSource   = new List <object>();
                FieldToCopyGrid.ItemsSource  = new List <object>();
                WorkFlowListGrid.ItemsSource = new List <object>();
                finalFieldMap   = new Hashtable();
                copyingFieldSet = new Hashtable();
                migrateTypeSet  = new List <object>();


                NetworkCredential    netCred   = new NetworkCredential("*****@*****.**", "px3iifegtadud3p33ma55vvf2ign7y7j6tdb4hvs43jefuwym6oa");
                BasicAuthCredential  basicCred = new BasicAuthCredential(netCred);
                TfsClientCredentials tfsCred   = new TfsClientCredentials(basicCred);
                tfsCred.AllowInteractive = false;
                TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri("https://apra-amcos.visualstudio.com"), tfsCred);


                tpc.Authenticate();
                this.destinationTFS   = tpc;
                this.destinationStore = (WorkItemStore)destinationTFS.GetService(typeof(WorkItemStore));

                this.destinationProject     = destinationStore.Projects["TestMigration"];
                DestinationProjectText.Text = string.Format("{0}/{1}", destinationTFS.Uri.ToString(), destinationProject.Name);
                writeTarget = new WorkItemWrite(destinationTFS, destinationProject);



                if ((string)ConnectionStatusLabel.Content == "Select a Target project")
                {
                    ConnectionStatusLabel.Content = "";
                }
            }
        }
        private void ConnectDestinationProjectButton_Click(object sender, RoutedEventArgs e)
        {
            TeamProjectPicker tpp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
            DialogResult result = tpp.ShowDialog();

            if (result.ToString() == "OK")
            {
                StatusViwer.Content = "";
                MigratingLabel.Content = "";
                StatusBar.Value = 0;
                SourceFieldGrid.ItemsSource = new List<string>();
                TargetFieldGrid.ItemsSource = new List<string>();
                MappedListGrid.ItemsSource = new List<object>();
                FieldToCopyGrid.ItemsSource = new List<object>();
                WorkFlowListGrid.ItemsSource = new List<object>();
                finalFieldMap = new Hashtable();
                copyingFieldSet = new Hashtable();
                migrateTypeSet = new List<object>();

                destinationTFS = tpp.SelectedTeamProjectCollection;
                destinationStore = (WorkItemStore)destinationTFS.GetService(typeof(WorkItemStore));

                destinationProject = destinationStore.Projects[tpp.SelectedProjects[0].Name];
                DestinationProjectText.Text = string.Format("{0}/{1}", destinationTFS.Uri.ToString(), destinationProject.Name);
                writeTarget = new WorkItemWrite(destinationTFS, destinationProject);

                if ((string)ConnectionStatusLabel.Content == "Select a Target project")
                {
                    ConnectionStatusLabel.Content = "";
                }
            }
        }