Ejemplo n.º 1
0
 internal HiApplication LookUp(string url)
 {
     if ((this.Pattern == null) || this.regex.IsMatch(url))
     {
         for (int i = 0; i < this.keys.Count; i++)
         {
             HiApplication application = this.ht[this.keys[i]] as HiApplication;
             if (application.IsMatch(url))
             {
                 return(application);
             }
         }
         if (this.DefaultName != null)
         {
             return(this.ht[this.DefaultName] as HiApplication);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
        internal HiApplication CurrentHiApplication()
        {
            HttpContext current = HttpContext.Current;

            if (current == null)
            {
                return(null);
            }
            HiApplication application = current.Items["AppLocation"] as HiApplication;

            if (application == null)
            {
                application = this.LookUp(current.Request.Path);
                if (application != null)
                {
                    current.Items.Add("AppLocation", application);
                }
            }
            return(application);
        }