コード例 #1
0
        public void projectMigration()
        {
            logger.InfoFormat("--------------------------------Migration from '{0}' to '{1}' Start----------------------------------------------", sourceProject.Name, destinationProject.Name);
            CheckTestPlanTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckTestPlanTextBlock.Visibility = Visibility.Hidden;
            }));
            CheckLogTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckLogTextBlock.Visibility = Visibility.Hidden;
            }));
            MigratingLabel.Dispatcher.BeginInvoke(new Action(delegate()
            {
                MigratingLabel.Content = "Migrating...";
            }));

            StatusBar.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusBar.Visibility = Visibility.Visible;
            }));
            WorkItemCollection source = readSource.GetWorkItems(sourceProject.Name, IsNotIncludeClosed, IsNotIncludeRemoved); //Get Workitems from source tfs

            XmlNode[] iterations = readSource.PopulateIterations();                                                           //Get Iterations and Areas from source tfs

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = "Generating Areas...";
            }));
            writeTarget.GenerateAreas(iterations[0], sourceProject.Name); //Copy Areas

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nGenerating Iterations...";
            }));
            writeTarget.GenerateIterations(iterations[1], sourceProject.Name); //Copy Iterations

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Team Queries...";
            }));
            writeTarget.SetTeamQueries(readSource.queryCol, sourceProject.Name); //Copy Queries

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Work Items...";
            }));
            writeTarget.writeWorkItems(sourceStore, source, sourceProject.Name, StatusBar, finalFieldMap); //Copy Workitems

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Test Plans...";
            }));
            TestPlanMigration tcm = new TestPlanMigration(sourceTFS, destinationTFS, sourceProject.Name, destinationProject.Name, writeTarget.itemMap, StatusBar);

            tcm.CopyTestPlans(); //Copy Test Plans

            MigratingLabel.Dispatcher.BeginInvoke(new Action(delegate()
            {
                MigratingLabel.Content = "Project Migrated";
            }));

            StatusBar.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusBar.Visibility = Visibility.Hidden;
            }));
            CheckTestPlanTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckTestPlanTextBlock.Visibility = Visibility.Visible;
            }));
            CheckLogTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckLogTextBlock.Visibility = Visibility.Visible;
            }));
            logger.Info("--------------------------------Migration END----------------------------------------------");
        }
コード例 #2
0
        public void projectMigration()
        {
            logger.InfoFormat("--------------------------------Migration from '{0}' to '{1}' Start----------------------------------------------", sourceProject.Name, destinationProject.Name);
            CheckTestPlanTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckTestPlanTextBlock.Visibility = Visibility.Hidden;
            }));
            CheckLogTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckLogTextBlock.Visibility = Visibility.Hidden;
            }));
            MigratingLabel.Dispatcher.BeginInvoke(new Action(delegate()
            {
                MigratingLabel.Content = "Migrating...";
            }));

            StatusBar.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusBar.Visibility = Visibility.Visible;
            }));
            WorkItemCollection source = readSource.GetWorkItems(sourceProject.Name, IsNotIncludeClosed, IsNotIncludeRemoved, StatusBar); //Get Workitems from source tfs
            XmlNode[] iterations = readSource.PopulateIterations(); //Get Iterations and Areas from source tfs

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = "Generating Areas...";
            }));
            writeTarget.GenerateAreas(iterations[0], sourceProject.Name); //Copy Areas

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nGenerating Iterations...";
            }));
            writeTarget.GenerateIterations(iterations[1], sourceProject.Name); //Copy Iterations

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Team Queries...";
            }));
            writeTarget.SetTeamQueries(readSource.queryCol, sourceProject.Name); //Copy Queries

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Work Items...";
            }));
            writeTarget.writeWorkItems(sourceStore, source, sourceProject.Name, StatusBar, finalFieldMap); //Copy Workitems

            StatusViwer.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusViwer.Content = StatusViwer.Content + "\nCopying Test Plans...";
            }));
            TestPlanMigration tcm = new TestPlanMigration(sourceTFS, destinationTFS, sourceProject.Name, destinationProject.Name, writeTarget.itemMap, StatusBar);
            tcm.CopyTestPlans(); //Copy Test Plans

            MigratingLabel.Dispatcher.BeginInvoke(new Action(delegate()
            {
                MigratingLabel.Content = "Project Migrated";
            }));

            StatusBar.Dispatcher.BeginInvoke(new Action(delegate()
            {
                StatusBar.Visibility = Visibility.Hidden;
            }));
            CheckTestPlanTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckTestPlanTextBlock.Visibility = Visibility.Visible;
            }));
            CheckLogTextBlock.Dispatcher.BeginInvoke(new Action(delegate()
            {
                CheckLogTextBlock.Visibility = Visibility.Visible;
            }));
            logger.Info("--------------------------------Migration END----------------------------------------------");
        }