Esempio n. 1
0
        private async Task <IEnumerable <WorkItem> > GetWorkItems()
        {
            var query = serviceProvider.Get <SettingsService>().Get(SettingsKeys.WorkItemSectionQueryKey(UserContext), TfsContext.WorkItemManager.GetDefaultUserWorkItemQuery(UserContext.Identity));

            if (string.IsNullOrEmpty(query))
            {
                query = TfsContext.WorkItemManager.GetDefaultUserWorkItemQuery(UserContext.Identity);
            }
            return((await TfsContext.WorkItemManager.RunQueryAsync(query)).OfType <WorkItem>());
        }
Esempio n. 2
0
        private void ChangeWorkItemsQuery(object obj)
        {
            var query = serviceProvider.Get <SettingsService>().Get(SettingsKeys.WorkItemSectionQueryKey(UserContext), TfsContext.WorkItemManager.GetDefaultUserWorkItemQuery(UserContext.Identity));

            if (string.IsNullOrEmpty(query))
            {
                query = TfsContext.WorkItemManager.GetDefaultUserWorkItemQuery(UserContext.Identity);
            }
            QueryEditorDialog dialog = new QueryEditorDialog(query)
            {
                CanSelectQuery = true
            };

            dialog.RunQuery += (o, args) => TfsContext.WorkItemManager.ShowQueryResults(WorkItemManager.PrepareQueryText(dialog.Query));
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                serviceProvider.Get <SettingsService>().Set(SettingsKeys.WorkItemSectionQueryKey(UserContext), dialog.Query);
            }
        }