using System;
using Telerik.Sitefinity.Security.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<ProfileCreated>(evt => ProfileEventHandler(evt));
        }

        public void ProfileEventHandler(ProfileCreated eventInfo)
        {
            var profile = eventInfo.ProfileId;
            var provider = eventInfo.ProfileProviderName;
            var type = eventInfo.ProfileType;
            var user = eventInfo.UserId;
        }
    }
}