using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

using System.IO;

namespace TutorialsSilverlight.Web
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            // to make AttachDbFilename=|DataDirectory| in connectionString in web.config work
            string folder = Path.GetFullPath(Path.Combine(Server.MapPath("/"), @"..\..\..\Data"));
            AppDomain.CurrentDomain.SetData("DataDirectory", folder);
            string dbFile = Path.Combine(folder, "Northwnd.mdf");
            if (!File.Exists(dbFile))
                throw new Exception("Sample database Northwnd.mdf must be created in the Samples\\Data folder. Run the CreateSampleDB utility to create the Northwnd database");
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}