public EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties)
        {
            statusCode    = 0;
            properties    = null;
            statusMessage = string.Empty;
            try
            {
                if (notificationType == NotificationType.Notification && notificationEventArgs is CheckinNotification)
                {
                    var checkinNotification = notificationEventArgs as CheckinNotification;
                    if (ShouldMergeItemsIfNecessary(requestContext, checkinNotification))
                    {
                        var changeset = requestContext.GetChangeset(checkinNotification.Changeset);
                        if (changeset != null)
                        {
                            TfsTeamProjectCollection impersonatedCollection = requestContext.GetImpersonatedCollection(changeset.Committer);
                            MergeWorkItems(impersonatedCollection, changeset.ChangesetId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TeamFoundationApplicationCore.LogException("Inmeta.TFS.MergeWorkItemEventHandler encountered an exception", ex);
            }

            return(EventNotificationStatus.ActionPermitted);
        }
        public EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties)
        {
            statusCode = 0;
            properties = null;
            statusMessage = string.Empty;
            try
            {
                if (notificationType == NotificationType.Notification && notificationEventArgs is CheckinNotification)
                {
                    var checkinNotification = notificationEventArgs as CheckinNotification;
                    if (ShouldMergeItemsIfNecessary(requestContext, checkinNotification))
                    {
                        var changeset = requestContext.GetChangeset(checkinNotification.Changeset);
                        if (changeset != null)
                        {
                            TfsTeamProjectCollection impersonatedCollection = requestContext.GetImpersonatedCollection(changeset.Committer);
                            MergeWorkItems(impersonatedCollection, changeset.ChangesetId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TeamFoundationApplicationCore.LogException("Inmeta.TFS.MergeWorkItemEventHandler encountered an exception", ex);
            }

            return EventNotificationStatus.ActionPermitted;
        }