Skip to content

Instantly share code, notes, and snippets.

@ianbattersby
Created May 19, 2011 14:59
Show Gist options
  • Save ianbattersby/980950 to your computer and use it in GitHub Desktop.
Save ianbattersby/980950 to your computer and use it in GitHub Desktop.
TFS Subscriber example, need to access WorkItemStore
public EventNotificationStatus ProcessEvent(
TeamFoundationRequestContext requestContext,
NotificationType notificationType,
object notificationEventArgs,
out int statusCode,
out string statusMessage,
out ExceptionPropertyCollection properties
)
{
statusCode = 0;
statusMessage = string.Empty;
properties = null;
if (notificationType == NotificationType.Notification && notificationEventArgs is WorkItemChangedEvent)
{
WorkItemChangedEvent data = notificationEventArgs as WorkItemChangedEvent;
// I now have access to the CoreFields and TextFields via WorkItemChangedEvent
// but I want to access other fields in the work item. It seems the only way to do
// this is to load the WorkItem from the WorkItemStore in full.
// Although I can connect to the WorkItemStore using the WorkItemTracking.Client
// methods this seems messy, and I'd have to construct the URL from
// TeamFoundationRequestContext - SURELY there a way to access the WorkItemStore
// using the existing context (TeamFoundationRequestContext)?
}
return EventNotificationStatus.ActionPermitted;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment