October 9, 2006 12:28 AM | Comments [0] | by Ed Kisinger
When playing around with this Interface you will notice that it is very easy to subscribe and unsubscribe to events via the TFS Object Model.The method signature for Subscribing to an event is:
int SubscribeEvent (
string userID,
string eventType,
string filterExpression,
DeliveryPreference preferences
)
As you can note there is several string values that are needed to pass in. I found no documentation on what eventTypes or Filter expressions were available. Hopefully the following information will help you as you develop with the Object Model.
UserID: simple enough.
eventType: Out of the Box
To view event types on a certain TFS server you can consume http://ServerName:8080/Services/v1.0/Registration.asmx to enumerate through the listor, you can use the IRegistration interface and loop through each RegistrationEntry for each EventType.
Filter Expression:
Example expression:
Condition String = "PortfolioProject" = 'Project Name' AND ("CoreFields/StringFields/Field[ReferenceName='System.AssignedTo']/OldValue" = 'Ed Kisinger' OR "CoreFields/StringFields/Field[ReferenceName='System.AssignedTo']/NewValue" = 'Ed Kisinger') AND "CoreFields/StringFields/Field[ReferenceName='System.AuthorizedAs']/NewValue" <> 'Ed Kisinger'
Ed K.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u