コード例 #1
0
 public IMigrationClientConfig PopulateWithDefault()
 {
     Project = "myProjectName";
     AllowCrossProjectLinking = false;
     Collection = new Uri("https://dev.azure.com/nkdagility-preview/");
     ReflectedWorkItemIDFieldName = "Custom.ReflectedWorkItemId";
     PersonalAccessToken          = "";
     AuthenticationMode           = AuthenticationMode.Prompt;
     LanguageMaps = new TfsLanguageMapOptions()
     {
         AreaPath = "Area", IterationPath = "Iteration"
     };
     return(this);
 }
コード例 #2
0
        private string NodeStructureTypeToLanguageSpecificName(TfsLanguageMapOptions languageMaps, TfsNodeStructureType value)
        {
            // insert switch statement here
            switch (value)
            {
            case TfsNodeStructureType.Area:
                return(languageMaps.AreaPath);

            case TfsNodeStructureType.Iteration:
                return(languageMaps.IterationPath);

            default:
                throw new InvalidOperationException("Not a valid NodeStructureType ");
            }
        }
コード例 #3
0
 protected override void EntryForProcessorType(IProcessor processor)
 {
     if (processor is null)
     {
         IMigrationEngine engine = Services.GetRequiredService <IMigrationEngine>();
         if (_sourceCommonStructureService is null)
         {
             _sourceCommonStructureService = (ICommonStructureService4)engine.Source.GetService <ICommonStructureService4>();
             _sourceProjectInfo            = _sourceCommonStructureService.GetProjectFromName(engine.Source.Config.AsTeamProjectConfig().Project);
             _sourceRootNodes    = _sourceCommonStructureService.ListStructures(_sourceProjectInfo.Uri);
             _sourceLanguageMaps = engine.Source.Config.AsTeamProjectConfig().LanguageMaps;
             _sourceProjectName  = engine.Source.Config.AsTeamProjectConfig().Project;
         }
         if (_targetCommonStructureService is null)
         {
             _targetCommonStructureService = (ICommonStructureService4)engine.Target.GetService <ICommonStructureService4>();
             _targetLanguageMaps           = engine.Target.Config.AsTeamProjectConfig().LanguageMaps;
             _targetProjectName            = engine.Target.Config.AsTeamProjectConfig().Project;
         }
     }
     else
     {
         if (_sourceCommonStructureService is null)
         {
             var source = (TfsWorkItemEndpoint)processor.Source;
             _sourceCommonStructureService = (ICommonStructureService4)source.TfsCollection.GetService <ICommonStructureService>();
             _sourceProjectInfo            = _sourceCommonStructureService.GetProjectFromName(source.Project);
             _sourceRootNodes    = _sourceCommonStructureService.ListStructures(_sourceProjectInfo.Uri);
             _sourceLanguageMaps = source.Options.LanguageMaps;
             _sourceProjectName  = source.Project;
         }
         if (_targetCommonStructureService is null)
         {
             var target = (TfsWorkItemEndpoint)processor.Target;
             _targetCommonStructureService = (ICommonStructureService4)target.TfsCollection.GetService <ICommonStructureService4>();
             _targetLanguageMaps           = target.Options.LanguageMaps;
             _targetProjectName            = target.Project;
         }
     }
 }