a·gen·tic a·gil·i·ty

Team Server Event Handlers made easy

Explains a simple way for power users to create, upload, and manage custom event handlers for Team Foundation Server events using an admin interface and web services.

Published on
2 minute read
Image
https://nkdagility.com/resources/NjGpMY3aKfH
Subscribe

Will, not really…

I work for a rather large organization and I wanted an easy way for power users of team system to deploy event handlers for the Team Foundation Server events. Essentially they create an assembly with as many EventHandler classes as they like and they can upload their assembly through an administration system, which in turn executes any handlers that exist on the system for any events.

The Event Handler class format:

<EventHandler(EventType:=EventTypes.WorkItemChangedEvent, LogEmail:= someone@company.com )>_

<Logging(Enable:=True, Verbose:=True) _

Public Class MyEventHandler

Inherits AEventHandler(of WorkItemChangedEvent)

Public Sub Run(TeamServer as TeamFoundation Server, e as EventHandlerArgs(of WorkItemChangedEvent))

’ Run any code for the event

End Sub

Public Sub IsValid(TeamServer as TeamFoundation Server, e as EventHandlerArgs(of WorkItemChangedEvent))

’ Check validity of the event

End Sub

End Class

Public Class EventHandlerArgs(Of TEvent as {ATfsEvent})

’ This is the type of event that is being created as an enumerator

Public Readonly Property EventType as EventTypes

’ This is the actual body of the event as a WorkItemChangedEvent or CheckInEvent etc..

Public Readonly Property [Event] as TEvent

’ This holds the URL of the Team Foundation Server server that the event originated from

Public Readonly Property Identity as TfsIdentity

’ The subscription info shows information about the subscription options

Public Readonly Property SubscriptionInfo as SubscritpionInfo

Public Sub New(ByVal EventType as EventTypes, ByVal [Event] as TEvent, ByVal Identity as TfsIdentity, ByVal SubscriptionInfo as SubscritpionInfo)

End Class

There is then a system that handles all of the events and is subscribed through the Bizsubscribe tool, but that allows a user to administer their own EventHandler’s through and admin system (Web, Form or XBAP) through a bunch of web services. There is a lot of code, and not enough room to put it up here, I may start a CodePlex project. I will be adding the admin system for this to our TeamPlain site and I may set it up to deploy as such. I will also require to create a visual studio project template thingy.

I am afraid I had to code from memory, so any errors or omissions are just my a sign of me getting old, but I hope you get the point and the ease with which you could write and deploy EventHandler’s with this.

Technorati Tags: .NET   TFS Custom   WIT

Subscribe

Related Blog

No related videos found.

Connect with Martin Hinshelwood

If you've made it this far, it's worth connecting with our principal consultant and coach, Martin Hinshelwood, for a 30-minute 'ask me anything' call.

Our Happy Clients​

We partner with businesses across diverse industries, including finance, insurance, healthcare, pharmaceuticals, technology, engineering, transportation, hospitality, entertainment, legal, government, and military sectors.​

Graham & Brown Logo

Graham & Brown

SuperControl Logo

SuperControl

MacDonald Humfrey (Automation) Ltd. Logo

MacDonald Humfrey (Automation) Ltd.

Workday Logo

Workday

Healthgrades Logo

Healthgrades

Cognizant Microsoft Business Group (MBG) Logo

Cognizant Microsoft Business Group (MBG)

CR2

Jack Links Logo

Jack Links

Alignment Healthcare Logo

Alignment Healthcare

Sage Logo

Sage

Slaughter and May Logo

Slaughter and May

Boxit Document Solutions Logo

Boxit Document Solutions

Higher Education Statistics Agency Logo

Higher Education Statistics Agency

Epic Games Logo

Epic Games

Xceptor - Process and Data Automation Logo

Xceptor - Process and Data Automation

Akaditi Logo

Akaditi

Capita Secure Information Solutions Ltd Logo

Capita Secure Information Solutions Ltd

Genus Breeding Ltd Logo

Genus Breeding Ltd

Washington Department of Enterprise Services Logo

Washington Department of Enterprise Services

Washington Department of Transport Logo

Washington Department of Transport

New Hampshire Supreme Court Logo

New Hampshire Supreme Court

Nottingham County Council Logo

Nottingham County Council

Ghana Police Service Logo

Ghana Police Service

Department of Work and Pensions (UK) Logo

Department of Work and Pensions (UK)

ProgramUtvikling Logo

ProgramUtvikling

Flowmaster (a Mentor Graphics Company) Logo

Flowmaster (a Mentor Graphics Company)

Boxit Document Solutions Logo

Boxit Document Solutions

Genus Breeding Ltd Logo

Genus Breeding Ltd

DFDS Logo

DFDS

CR2