download Global.cs
Language: C#
Copyright: (C) 2008. All Rights Reserved.
LOC: 51
Project Info
Just Another Web Site(jaws)
Server: CodePlex1
Type: svn
...aws\Jaws.Core.Web\Controls\
   BasePage.cs
   Global.cs
   UserControlBase.cs
   WebPartControlBase.cs

//Created by Roman Clarkson for Jaws.Core.Web
//Original work Copyright(C) 2008.  All Rights Reserved.

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Web;
using Jaws.Core.Web.Attributes;

namespace Jaws.Core.Web.Controls
{
    public class Global : HttpApplication
    {
        public List<UserControlAttribute> PublicUserControlMembers { get; private set; }

        protected void Application_Start(object sender, EventArgs e)
        {
            PublicUserControlMembers = new List<UserControlAttribute>();
            GetPublicUserControls();
        }

        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)
        {
        }

        protected void GetPublicUserControls()
        {
            Assembly asm = Assembly.GetExecutingAssembly();
            if (asm != null)
                foreach (Type t in asm.GetTypes())
                {
                    object[] attributes = t.GetCustomAttributes(typeof (UserControlAttribute), false);
                    foreach (object o in attributes)
                    {
                        if (o is UserControlAttribute)
                        {
                            PublicUserControlMembers.Add((UserControlAttribute) o);
                        }
                    }
                }
        }
    }
}

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us