Ejemplo n.º 1
0
        public void DeleteQueryOrFolderByPath()
        {
            Guid   projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id;
            string path      = "My Queries/Sample";

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            workItemTrackingClient.DeleteQueryAsync(projectId, path);

            Console.WriteLine("Query/folder deleted");
        }
Ejemplo n.º 2
0
        public void DeleteQueryOrFolderById()
        {
            Guid projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id;
            Guid queryId   = this.Context.GetValue <Guid>("$sampleQueryId");

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            workItemTrackingClient.DeleteQueryAsync(projectId, queryId.ToString());

            Console.WriteLine("Query/folder deleted");
        }
Ejemplo n.º 3
0
        public void DeleteQueryById()
        {
            Guid projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id;
            Guid queryId   = this.Context.GetValue <Guid>("$sampleQueryId");

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            try
            {
                workItemTrackingClient.DeleteQueryAsync(projectId, queryId.ToString());
                Console.WriteLine("Query deleted");
            }
            catch (AggregateException ex)
            {
                Console.WriteLine("Error deleting query: " + ex.InnerException.Message);
            }
        }
Ejemplo n.º 4
0
        public void DeleteFolderByPath()
        {
            Guid   projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id;
            string path      = _folder;

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            try
            {
                workItemTrackingClient.DeleteQueryAsync(projectId, path);

                Console.WriteLine("Folder deleted");
            }
            catch (AggregateException ex)
            {
                Console.WriteLine("Error deleting folder: " + ex.InnerException.Message);
            }
        }
Ejemplo n.º 5
0
        public static async Task RemoveQueryAsync(this WorkItemTrackingHttpClient source, TeamProject project, QueryHierarchyItem query, CancellationToken cancellationToken)
        {
            await source.DeleteQueryAsync(project.Id, query.Path, cancellationToken : cancellationToken);

            Logger.Debug($"Removed query '{project}/{query.Path}'");
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Remove Existing Query or Folder
 /// </summary>
 /// <param name="project"></param>
 /// <param name="queryPath"></param>
 static void RemoveQuery(string project, string queryPath)
 {
     WitClient.DeleteQueryAsync(project, queryPath);
 }