using System;
using Telerik.Sitefinity.Forums.Events;
using Telerik.Sitefinity.Services;

namespace SitefinityWebApp
{
    public class Global : System.Web.HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            SystemManager.ApplicationStart += new EventHandler<EventArgs>(ApplicationStartHandler);
        }

        private void ApplicationStartHandler(object sender, EventArgs e)
        {
            EventHub.Subscribe<IForumGroupUpdatedEvent>(evt => ForumGroupUpdatedEventHandler(evt));
        }

        public void ForumGroupUpdatedEventHandler(IForumGroupUpdatedEvent eventInfo)
        {
            var forumsUserId = eventInfo.UserId;
            var forumGroupId = eventInfo.ForumGroupId;
            var forumGroupTitle = eventInfo.Title;
            var forumGroupVisible = eventInfo.Visible;
            var forumGroupCreationDate = eventInfo.ModificationDate;
        }
    }
}