/// <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();
        }
예제 #2
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;
        }
        /// <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();
        }