Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Microsoft.TeamFoundation.Client;
- using System.Net;
- using Microsoft.TeamFoundation.VersionControl.Client;
- using Microsoft.TeamFoundation.WorkItemTracking.Client;
- using Microsoft.TeamFoundation.Framework.Client;
- namespace TFSEvents
- {
- class Program
- {
- static void Main(string[] args)
- {
- try
- {
- Uri serverUri = new Uri(@"http://bach.consindia.in:8080/tfs");
- string username, password;
- Console.WriteLine("Enter Username:");
- username = Console.ReadLine();
- Console.WriteLine("Enter password:");
- password = ReadPassword();
- NetworkCredential cred = new NetworkCredential(username, password);
- TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(serverUri, cred);
- tfs.EnsureAuthenticated();
- IEventService vs = tfs.GetService<IEventService>();
- var wiww = tfs.GetService<WorkItemStore>();
- var wi = wiww.GetWorkItem(4671);
- wi.FieldChanged += new WorkItemFieldChangeEventHandler(changeHandler);
- var x = vs.GetAllEventSubscriptions().ToList();
- Console.WriteLine("Press 'q' to quit.");
- while (Console.ReadLine() != "q") ;
- }
- catch (Exception e)
- {
- }
- }
- private static void changeHandler(object o, WorkItemEventArgs e)
- {
- Console.WriteLine(e.Field);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement