示例#1
0
        public WorkItemStoreContext(ITeamProjectContext teamProjectContext, WorkItemStoreFlags bypassRules)
        {
            var startTime = DateTime.UtcNow;
            var timer     = System.Diagnostics.Stopwatch.StartNew();

            this.teamProjectContext = teamProjectContext;
            this.bypassRules        = bypassRules;
            try
            {
                wistore = new WorkItemStore(teamProjectContext.Collection, bypassRules);
                timer.Stop();
                Telemetry.Current.TrackDependency("TeamService", "GetWorkItemStore", startTime, timer.Elapsed, true);
            }
            catch (Exception ex)
            {
                timer.Stop();
                Telemetry.Current.TrackDependency("TeamService", "GetWorkItemStore", startTime, timer.Elapsed, false);
                Telemetry.Current.TrackException(ex,
                                                 new Dictionary <string, string> {
                    { "CollectionUrl", teamProjectContext.Collection.Uri.ToString() }
                },
                                                 new Dictionary <string, double> {
                    { "Time", timer.ElapsedMilliseconds }
                });
                Trace.TraceWarning($"  [EXCEPTION] {ex}");
                throw;
            }

            foundWis = new Dictionary <int, WorkItem>();
        }
示例#2
0
 private void ProcessConfiguration()
 {
     _Telemetry.EnableTrace = _Config.TelemetryEnableTrace;
     if (_Config.Source != null)
     {
         ITeamProjectContext tpc = _Host.Services.GetRequiredService <ITeamProjectContext>();
         if (_SourceCreds == null)
         {
             tpc.Connect(_Config.Source);
         }
         else
         {
             tpc.Connect(_Config.Source, _SourceCreds);
         }
         _Source = tpc;
     }
     if (_Config.Target != null)
     {
         ITeamProjectContext tpc = _Host.Services.GetRequiredService <ITeamProjectContext>();
         if (_TargetCreds == null)
         {
             tpc.Connect(_Config.Target);
         }
         else
         {
             tpc.Connect(_Config.Target, _TargetCreds);
         }
         _Source = tpc;
     }
 }
示例#3
0
 public TestManagementContext(ITeamProjectContext source, string testPlanQueryBit)
 {
     this.testPlanQueryBit = testPlanQueryBit;
     this.source           = source;
     tms     = (ITestManagementService)source.Collection.GetService(typeof(ITestManagementService));
     Project = tms.GetTeamProject(source.Name);
 }
 public void SetTarget(ITeamProjectContext teamProjectContext)
 {
     target = teamProjectContext;
 }
 public void SetSource(ITeamProjectContext teamProjectContext)
 {
     source = teamProjectContext;
 }
示例#6
0
 public TestManagementContext(ITeamProjectContext source)
 {
     this.source = source;
     tms         = (ITestManagementService)source.Collection.GetService(typeof(ITestManagementService));
     project     = tms.GetTeamProject(source.Name);
 }
示例#7
0
 public TestManagementContext(ITeamProjectContext source) : this(source, null)
 {
 }