Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestSpecificationReportModel"/> class.
        /// </summary>
        /// <param name="syncServiceDocumentModel">The <see cref="ISyncServiceModel"/> to obtain document settings.</param>
        /// <param name="dispatcher">Dispatcher of associated view.</param>
        /// <param name="testAdapter"><see cref="ITfsTestAdapter"/> to examine test information.</param>
        /// <param name="wordRibbon">Interface to the word ribbon</param>
        /// <param name="testReportingProgressCancellationService">The progess cancellation service used to check at certain points if a cancellation has been triggered and further steps should be skipped.</param>
        public TestSpecificationReportModel(ISyncServiceDocumentModel syncServiceDocumentModel, IViewDispatcher dispatcher,
                                            ITfsTestAdapter testAdapter, IWordRibbon wordRibbon, ITestReportingProgressCancellationService testReportingProgressCancellationService)
            : base(syncServiceDocumentModel, dispatcher, testAdapter, wordRibbon, testReportingProgressCancellationService)
        {
            CreateDocumentStructure = StoredCreateDocumentStructure;
            SkipLevels = StoredSkipLevels;
            SelectedDocumentStructureType = StoredSelectedDocumentStructureType;
            SelectedTestCaseSortType      = StoredSelectedTestCaseSortType;
            CreateReportCommand           = new ViewCommand(ExecuteCreateReportCommand, CanExecuteCreateReportCommand);
            SetTestReportDefaults(syncServiceDocumentModel.Configuration.ConfigurationTest.ConfigurationTestSpecification.DefaultValues);

            WordDocument = syncServiceDocumentModel.WordDocument as Document;
        }
Пример #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;
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestResultReportModel"/> class.
        /// </summary>
        /// <param name="syncServiceDocumentModel">The <see cref="ISyncServiceDocumentModel"/> to obtain document settings.</param>
        /// <param name="viewDispatcher"> Instance of <see cref="IViewDispatcher"/> of associated view.</param>
        /// <param name="testAdapter"><see cref="ITfsTestAdapter"/> to examine test information.</param>
        /// <param name="wordRibbon">Interface to the word ribbon</param>
        /// <param name="testReportingProgressCancellationService">The <see cref="ITestReportingProgressCancellationService"/> indicating that a cancellation is requested.</param>
        protected TestReportModel(ISyncServiceDocumentModel syncServiceDocumentModel, IViewDispatcher viewDispatcher, ITfsTestAdapter testAdapter, IWordRibbon wordRibbon, ITestReportingProgressCancellationService testReportingProgressCancellationService)
        {
            if (syncServiceDocumentModel == null)
            {
                throw new ArgumentNullException("syncServiceDocumentModel");
            }
            if (testAdapter == null)
            {
                throw new ArgumentNullException("testAdapter");
            }
            if (wordRibbon == null)
            {
                throw new ArgumentNullException("wordRibbon");
            }
            if (testReportingProgressCancellationService == null)
            {
                throw new ArgumentNullException("testReportingProgressCancellationService");
            }
            if (viewDispatcher == null)
            {
                throw new ArgumentNullException("viewDispatcher");
            }

            SyncServiceDocumentModel = syncServiceDocumentModel;
            WordRibbon     = wordRibbon;
            TestAdapter    = testAdapter;
            ViewDispatcher = viewDispatcher;

            Document = syncServiceDocumentModel.WordDocument as Document;

            _modelKey   = GetType().Name;
            _storedData = new Dictionary <string, string>();
            ParseStoredData(SyncServiceDocumentModel.ReadTestReportData(_modelKey));

            _generatingActive = SyncServiceDocumentModel.TestReportRunning;
            _operationActive  = SyncServiceDocumentModel.TestReportRunning;

            TestReportingProgressCancellationService = testReportingProgressCancellationService;
        }
        /// <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();
        }