/// <summary>
        /// Initializes a new instance of the <see cref="TestSpecificationReportByQueryModel" /> class for the console extension.
        /// </summary>
        /// <param name="tfsService">Team foundation service.</param>
        /// <param name="documentModel">Model of word document to work with.</param>
        /// <param name="testAdapter">The test adapter.</param>
        /// <param name="workitems">The work items.</param>
        public TestSpecificationReportByQueryModel(ITfsService tfsService, ISyncServiceDocumentModel documentModel,
                                                   ITfsTestAdapter testAdapter, List <int> workitems)
        {
            if (tfsService == null)
            {
                throw new ArgumentNullException("tfsService");
            }
            if (documentModel == null)
            {
                throw new ArgumentNullException("documentModel");
            }

            TfsService   = tfsService;
            _testAdapter = testAdapter;

            WordDocument  = documentModel.WordDocument as Document;
            DocumentModel = documentModel;
            DocumentModel.PropertyChanged += DocumentModelOnPropertyChanged;

            _queryConfiguration = new QueryConfiguration
            {
                UseLinkedWorkItems = false
            };
            _queryConfiguration.ImportOption = QueryImportOption.IDs;
            _queryConfiguration.ByIDs        = workitems;

            LinkTypes = TfsService.GetLinkTypes().Select(
                x => new DataItemModel <ITFSWorkItemLinkType>(x)
            {
                IsChecked = QueryConfiguration.LinkTypes.Contains(x.ReferenceName)
            }).ToList();
        }
Ejemplo n.º 2
0
 public ProjectsListViewModel(ITfsService tfsService, IExtNavigationService navService, IPopupService popupService) : base(navService, popupService)
 {
     _tfsService = tfsService;
     MessagingCenter.Subscribe <LoginViewModel, CollectionResponse <Project> >(this, Messages.SetProjectsListMessage, (sender, args) =>
     {
         Projects = new ObservableCollection <Project>(args.Value);
     });
 }
Ejemplo n.º 3
0
        public TfsBuildMonitorManager(ITfsService tfsService)
        {
            _tfsService      = tfsService;
            _pollingInterval = double.Parse(ConfigurationManager.AppSettings["polling_interval"]);

            _timer          = new Timer(_pollingInterval * 1000);
            _timer.Elapsed += _timer_Elapsed;
        }
Ejemplo n.º 4
0
 public WorkItemDetailsViewModel(ITfsService tfsService, IExtNavigationService navService, IPopupService popupService) : base(navService, popupService)
 {
     _tfsService = tfsService;
     MessagingCenter.Subscribe <WorkItemsListViewModel, WorkItem>(this, Messages.SetWorkItemMessage, async(sender, args) =>
     {
         await InitForm();
         await SetWorkItemDetails(args);
     });
 }
        public MainWindowViewModel(IConfigManager configManager, ITfsService tfsService = null)
        {
            StatusIndicators = new List<IBuildStatusIndicator>();
            _configManager = configManager;
            _tfsService = tfsService;

            _timer = new Timer(10000) {Enabled = false};
            _timer.Elapsed += QueryBuildStatus;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Verifies the template mapping.
        /// </summary>
        /// <param name="serviceModel">The service document model.</param>
        /// <param name="syncAdapter">The sync adapter.</param>
        /// <param name="configuration">Configuration with the field to check for existence on the server</param>
        public bool VerifyTemplateMapping(ISyncServiceDocumentModel serviceModel, ITfsService syncAdapter, IConfiguration configuration)
        {
            Guard.ThrowOnArgumentNull(serviceModel, "serviceModel");
            Guard.ThrowOnArgumentNull(syncAdapter, "syncAdapter");
            Guard.ThrowOnArgumentNull(configuration, "configuration");

            _missingFields.Clear();

            // check each mapping field
            foreach (var configurationItem in configuration.GetConfigurationItems())
            {
                if (!configurationItem.RelatedSchema.Equals(serviceModel.MappingShowName))
                {
                    continue;
                }
                foreach (var fieldItem in configurationItem.FieldConfigurations)
                {
                    var fieldExists = syncAdapter.FieldDefinitions.Cast <FieldDefinition>().Any(field => fieldItem.ReferenceFieldName.Equals(field.ReferenceName));

                    if (!fieldExists)
                    {
                        // add missing fields to collection if it is not based on variable type
                        fieldItem.SourceMappingName = configurationItem.WorkItemTypeMapping;

                        if (!fieldItem.FieldValueType.IsVariable())
                        {
                            _missingFields.Add(fieldItem);
                        }
                    }
                    //Field Exists, check if the defintions are right
                    else
                    {
                        //If the field on Word is handeled as HTML, check the counterpart on the tfs
                        if (fieldItem.FieldValueType == FieldValueType.HTML)
                        {
                            //Get the TFS Item
                            var tfsFieldItem = syncAdapter.FieldDefinitions[fieldItem.ReferenceFieldName];

                            if (tfsFieldItem.FieldType != FieldType.Html)
                            {
                                fieldItem.SourceMappingName = configurationItem.WorkItemTypeMapping;
                                _wrongMappedFields.Add(fieldItem);
                            }
                        }
                    }
                }
            }

            // return true if there were no missing fields or no wrong mapped field, else false.
            if (_missingFields.Count == 0 && _wrongMappedFields.Count == 0)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Get the necessary services
        /// </summary>
        private void GetService()
        {
            _workItemSyncService = SyncServiceFactory.GetService <IWorkItemSyncService>();
            _configService       = SyncServiceFactory.GetService <IConfigurationService>();
            _configuration       = _configService.GetConfiguration(_wordDocument);


            _tfsService  = SyncServiceFactory.CreateTfsService(_documentModel.TfsServer, _documentModel.TfsProject, _documentModel.Configuration);
            _source      = SyncServiceFactory.CreateTfs2008WorkItemSyncAdapter(_documentModel.TfsServer, _documentModel.TfsProject, null, _configuration);
            _destination = SyncServiceFactory.CreateWord2007TableWorkItemSyncAdapter(_wordDocument, _configuration);
        }
 public UpdatedPullRequestHandler(
     PullRequestMatcher pullRequestMatcher,
     ITfsService tfsService,
     string projectName,
     string buildDefinitionName)
 {
     _pullRequestMatcher  = pullRequestMatcher;
     _tfsService          = tfsService;
     _projectName         = projectName;
     _buildDefinitionName = buildDefinitionName;
 }
Ejemplo n.º 9
0
 public LoginViewModel(IExtNavigationService navService, IPopupService popupService, ITfsService tfsService) : base(navService, popupService)
 {
     _tfsService = tfsService;
     MessagingCenter.Subscribe <App>(this, Messages.SignInMessage, async(sender) =>
     {
         if (!String.IsNullOrEmpty(Settings.Password) && !String.IsNullOrEmpty(Settings.Username))
         {
             await SignIn(Settings.Username, Settings.Password);
         }
     });
 }
        public UpdatedPullRequestHandlerTests()
        {
            _tfsService = Substitute.For <ITfsService>();
            _matcher    = new PullRequestMatcher("repo-.+", "master", "completed");

            _sut = new UpdatedPullRequestHandler(
                _matcher,
                _tfsService,
                ProjectName,
                BuildDefinitionName);
        }
Ejemplo n.º 11
0
 public WorkItemsListViewModel(ITfsService tfsService, IExtNavigationService navService, IPopupService popupService) : base(navService, popupService)
 {
     _tfsService = tfsService;
     MessagingCenter.Subscribe <IterationsListViewModel, IEnumerable <int> >(this, Messages.SetWorkItemsListMessage, async(sender, args) =>
     {
         if (WorkItems != null)
         {
             WorkItems.Clear();
         }
         await GetWorkItems(args);
     });
 }
 public MigrateVersionControlHostedService(ILogger logger, IGitService gitService, ITfsService tfsService, IDirectoryService directoryService,
                                           IApplicationLifetime appLifetime, ICommandlineArgsHelper commandlineArgsHelper, SourceConnectionConfiguration sourceConnectionConfiguration,
                                           TargetConnectionConfiguration targetConnectionConfiguration, LocalConfiguration localConfiguration)
 {
     _logger                        = logger;
     _gitService                    = gitService;
     _tfsService                    = tfsService;
     _directoryService              = directoryService;
     _appLifetime                   = appLifetime;
     _commandlineArgsHelper         = commandlineArgsHelper;
     _sourceConnectionConfiguration = sourceConnectionConfiguration;
     _targetConnectionConfiguration = targetConnectionConfiguration;
     _localConfiguration            = localConfiguration;
 }
Ejemplo n.º 13
0
        public TfsConnectorViewModel(ITfsService tfsService)
        {
            this.tfsService           = tfsService;
            this.ProjectName          = Properties.Settings.Default.tfsprojectName;
            this.queriesAlreadyLoaded = false;
            this.IsLoading            = Visibility.Hidden;
            this.ReloadTFSQueries     = new RelayCommand <object>(this.ExecuteReloadTFSQueries, o => true);

            this.ConfigureTfsUriAndProject = new RelayCommand <object>(this.ExecuteConfigureTfsUriAndProject, o => true);

            this.RenderDependenciesImageFromQuery = new RelayCommand <object>(this.ExecuteRenderDependenciesImageFromQuery, o => true);

            this.SearchPbiById = new RelayCommand <object>(this.ExecuteSearchPbiById, this.CanExecuteSearchPbiById);
        }
Ejemplo n.º 14
0
 public IterationsListViewModel(ITfsService tfsService, IExtNavigationService navService, IPopupService popupService) : base(navService, popupService)
 {
     _tfsService = tfsService;
     MessagingCenter.Subscribe <ProjectsListViewModel, Project>(this, Messages.SetProjectMessage, async(sender, args) =>
     {
         await GetProjectDetails(args.Id);
     });
     MessagingCenter.Subscribe <WorkItemDetailsViewModel, string>(this, Messages.SetIterationMessage, async(sender, name) =>
     {
         var iteration = _iterations.FirstOrDefault(i => i.Name.Contains(name) || name.Contains(i.Name));
         if (iteration != null)
         {
             await SetIteration(iteration);
         }
     });
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GetWorkItemsPanelViewModel"/> class.
        /// </summary>
        /// <param name="tfsService">Team foundation service.</param>
        /// <param name="documentModel">Model of word document to work with.</param>
        /// <param name="wordRibbon">Word ribbon.</param>
        public GetWorkItemsPanelViewModel(ITfsService tfsService, ISyncServiceDocumentModel documentModel, IWordRibbon wordRibbon)
        {
            if (tfsService == null)
            {
                throw new ArgumentNullException("tfsService");
            }
            if (documentModel == null)
            {
                throw new ArgumentNullException("documentModel");
            }
            if (wordRibbon == null)
            {
                throw new ArgumentNullException("wordRibbon");
            }
            TfsService = tfsService;
            WordRibbon = wordRibbon;

            WordDocument                   = documentModel.WordDocument as Document;
            DocumentModel                  = documentModel;
            _isDirectLinkOnlyMode          = DocumentModel.Configuration.GetDirectLinksOnly;
            DocumentModel.PropertyChanged += DocumentModelOnPropertyChanged;

            _queryConfiguration = new QueryConfiguration
            {
                UseLinkedWorkItems = false
            };

            DocumentModel.ReadQueryConfiguration(_queryConfiguration);
            SelectedQuery = FindQueryInHierarchy(QueryHierarchy, _queryConfiguration.QueryPath);

            var resultOfGetLinkTypes = TfsService.GetLinkTypes();

            if (resultOfGetLinkTypes != null)
            {
                LinkTypes = resultOfGetLinkTypes.Select(
                    x => new DataItemModel <ITFSWorkItemLinkType>(x)
                {
                    IsChecked = QueryConfiguration.LinkTypes.Contains(x.ReferenceName)
                }).ToList();
            }

            CollapseQueryTree        = DocumentModel.Configuration.CollapsQueryTree;
            IsExistNotShownWorkItems = false;
            SynchronizationState     = SynchronizationState.Unknown;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TestSpecificationReportByQueryModel" /> class.
        /// </summary>
        /// <param name="tfsService">Team foundation service.</param>
        /// <param name="documentModel">Model of word document to work with.</param>
        /// <param name="wordRibbon">Word ribbon.</param>
        /// <param name="testAdapter">The test adapter.</param>
        public TestSpecificationReportByQueryModel(ITfsService tfsService, ISyncServiceDocumentModel documentModel, IWordRibbon wordRibbon,
                                                   ITfsTestAdapter testAdapter)
        {
            if (tfsService == null)
            {
                throw new ArgumentNullException("tfsService");
            }
            if (documentModel == null)
            {
                throw new ArgumentNullException("documentModel");
            }
            if (wordRibbon == null)
            {
                throw new ArgumentNullException("wordRibbon");
            }

            TfsService = tfsService;
            WordRibbon = wordRibbon;

            _testAdapter = testAdapter;

            WordDocument  = documentModel.WordDocument as Document;
            DocumentModel = documentModel;
            DocumentModel.PropertyChanged += DocumentModelOnPropertyChanged;

            _queryConfiguration = new QueryConfiguration
            {
                UseLinkedWorkItems = false
            };
            DocumentModel.ReadQueryConfiguration(_queryConfiguration);
            SelectedQuery = FindQueryInHierarchy(QueryHierarchy, _queryConfiguration.QueryPath);

            LinkTypes = TfsService.GetLinkTypes().Select(
                x => new DataItemModel <ITFSWorkItemLinkType>(x)
            {
                IsChecked = QueryConfiguration.LinkTypes.Contains(x.ReferenceName)
            }).ToList();

            CollapseQueryTree = DocumentModel.Configuration.CollapsQueryTree;
        }
Ejemplo n.º 17
0
        public ChangesetModule(ITfsService tfsService, IChangesetService changesetService)
        {
            Get["/changesets"] = parameters =>
            {
                string source         = Request.Query.source;
                var    from           = Request.Query.from;
                bool   includeChanges = false;

                var history = changesetService.History(source, from, includeChanges);

                return(Response.AsJson((IEnumerable <TfsChangeset>)history));
            };

            Get["/changeset/{id}"] = _ =>
            {
                var id = _.id;

                var changeset = tfsService.VCS.GetChangeset(id);

                return(Response.AsJson((TfsChangeset)changeset.ToModel()));
            };
        }
Ejemplo n.º 18
0
        public ChangesetModule(ITfsService tfsService, IChangesetService changesetService)
        {
            Get["/changesets"] = parameters =>
            {
                string source = Request.Query.source;
                var from = Request.Query.from;
                bool includeChanges = false;

                var history = changesetService.History(source, from, includeChanges);

                return Response.AsJson((IEnumerable<TfsChangeset>)history);
            };

            Get["/changeset/{id}"] = _ =>
            {
                var id = _.id;

                var changeset = tfsService.VCS.GetChangeset(id);

                return Response.AsJson((TfsChangeset)changeset.ToModel());
            };
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetWorkItemsPanelViewModel"/> class.
        /// </summary>
        /// <param name="tfsService">Team foundation service.</param>
        /// <param name="documentModel">Model of word document to work with.</param>
        /// <param name="wordRibbon">Word ribbon.</param>
        public WorkItemOverviewPanelViewModel(ITfsService tfsService, ISyncServiceDocumentModel documentModel, IWordRibbon wordRibbon)
        {
            if (tfsService == null)
            {
                throw new ArgumentNullException("tfsService");
            }
            if (documentModel == null)
            {
                throw new ArgumentNullException("documentModel");
            }
            if (wordRibbon == null)
            {
                throw new ArgumentNullException("wordRibbon");
            }

            TfsService = tfsService;
            WordRibbon = wordRibbon;

            WordDocument  = documentModel.WordDocument as Document;
            DocumentModel = documentModel;
            DocumentModel.PropertyChanged += DocumentModelOnPropertyChanged;

            _queryConfiguration = new QueryConfiguration
            {
                UseLinkedWorkItems   = false,
                IsDirectLinkOnlyMode = false
            };
            DocumentModel.ReadQueryConfiguration(_queryConfiguration);
            SelectedQuery = FindQueryInHierarchy(QueryHierarchy, _queryConfiguration.QueryPath);

            LinkTypes = TfsService.GetLinkTypes().Select(
                x => new DataItemModel <ITFSWorkItemLinkType>(x)
            {
                IsChecked = QueryConfiguration.LinkTypes.Contains(x.ReferenceName)
            }).ToList();
        }
Ejemplo n.º 20
0
 public WorkItemsController(ITfsService tfsService)
 {
     _tfsService = tfsService;
 }
Ejemplo n.º 21
0
 public BranchService(ITfsService tfsService)
 {
     _tfsService = tfsService;
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AreaIterationPathViewModel"/> class.
 /// </summary>
 /// <param name="tfsService">Team foundation server service.</param>
 /// <param name="model">Associated model of word document.</param>
 public AreaIterationPathViewModel(ITfsService tfsService, ISyncServiceDocumentModel model)
 {
     TfsService    = tfsService;
     DocumentModel = model;
 }
 public ReputationController(ITfsService tfsService)
 {
     _tfsService = tfsService;
 }
 public AutoStatusSender(ITfsService _tfsService, IEmailSender _emailSender)
 {
     tfsService  = _tfsService;
     emailSender = _emailSender;
 }
 public StatusRepository()
 {
     tfsService  = new TfsService();
     emailSender = new EmailSender.EmailSender();
 }
Ejemplo n.º 26
0
 public ChangesetService(ITfsService tfsService)
 {
     _tfsService = tfsService;
 }
        public void SelectServer()
        {
            var picker = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false, new UICredentialsProvider());
            if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
                SelectedServerUri = picker.SelectedTeamProjectCollection.Uri.ToString();
                SelectedProjectName = picker.SelectedProjects[0].Name;

                TfsService = new TfsService(new Uri(SelectedServerUri));

                RefreshBuildDefinitions();
            }
        }
Ejemplo n.º 28
0
 public BranchService(ITfsService tfsService)
 {
     _tfsService = tfsService;
 }
Ejemplo n.º 29
0
 public ChangesetService(ITfsService tfsService)
 {
     _tfsService = tfsService;
 }