Esempio n. 1
0
        private void ShowChangesetsWithAffectedFiles()
        {
            TfsTeamProjectCollection tpc = visualStudioAdapter.GetCurrent();
            var workItemStore            = tpc.GetService <WorkItemStore>();
            var versionControlServer     = tpc.GetService <VersionControlServer>();
            var workItemCollector        = new WorkItemCollector(workItemStore);
            var model = new ShowChangesetsModel(workItemSelectionService, workItemCollector, workItemStore, versionControlServer, visualStudioAdapter);

            var dte  = (EnvDTE.DTE)Package.GetGlobalService(typeof(EnvDTE.DTE));
            var view = new ShowChangesetsView(dte);

            view.ConnectTo(model);

            model.Execute();
        }
        public void RefreshWorkItems(IResultsDocument queryResultsDocument)
        {
            string    query   = queryResultsDocument.QueryDocument.QueryText;
            Hashtable context = GetTfsQueryParameters(queryResultsDocument);

            var tpc           = visualStudioAdapter.GetCurrent();
            var workItemStore = tpc.GetService <WorkItemStore>();

            var workItemQuery = new Query(workItemStore, query, context);

            NumericFieldDefinitions = GetNumericFieldDefinitions(workItemQuery);

            if (!NumericFieldDefinitions.Any())
            {
                CurrentWorkItems = new WorkItem[0];
                return;
            }

            WorkItemCollection workItemCollection = workItemStore.GetWorkItems(workItemQuery, NumericFieldDefinitions);

            WorkItem[] workItemsA = new WorkItem[workItemCollection.Count];
            ((ICollection)workItemCollection).CopyTo(workItemsA, 0);

            CurrentWorkItems = workItemsA;

            RefreshTotals((queryResultsDocument.SelectedItemIds ?? new int[0]));
        }
Esempio n. 3
0
        public ReviewModel()
        {
            teamProjectCollectionProvider = IoC.GetInstance <IVisualStudioAdapter>();
            var tpc = teamProjectCollectionProvider.GetCurrent();

            workItemStore        = tpc.GetService <WorkItemStore>();
            versionControlServer = tpc.GetService <VersionControlServer>();
        }
Esempio n. 4
0
        public ReviewModel()
        {
            teamProjectCollectionProvider = IoC.GetInstance<IVisualStudioAdapter>();
            var tpc = teamProjectCollectionProvider.GetCurrent();

            workItemStore = tpc.GetService<WorkItemStore>();
            versionControlServer = tpc.GetService<VersionControlServer>();
        }
        public void Open(uint shortcutNr)
        {
            shortcutNr = shortcutNr & 0x0f;

            var queryPath = store.GetShortcut(shortcutNr);

            if (queryPath != null)
            {
                try
                {
                    var workItemStore = visualStudioAdapter.GetCurrent().GetService <WorkItemStore>();

                    QueryDefinition queryDefinition = workItemStore.GetQueryDefinition(queryPath);

                    if (queryDefinition != null)
                    {
                        ShowQueryResults(queryDefinition);
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Esempio n. 6
0
        public WorkItemCollection GetSelectedWorkItems()
        {
            var workItemStore = visualStudioAdapter.GetCurrent().GetService <WorkItemStore>();

            return(workItemStore.GetWorkItems(GetSelectedWorkItemIdentifiers()));
        }