Esempio 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);
 }
Esempio 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);
        }
Esempio n. 3
0
        internal HiApplication CurrentHiApplication()
        {
            HttpContext   current = HttpContext.Current;
            HiApplication result;

            if (current == null)
            {
                result = null;
            }
            else
            {
                HiApplication hiApplication = current.Items["AppLocation"] as HiApplication;
                if (hiApplication == null)
                {
                    hiApplication = this.LookUp(current.Request.Path);
                    if (hiApplication != null)
                    {
                        current.Items.Add("AppLocation", hiApplication);
                    }
                }
                result = hiApplication;
            }
            return(result);
        }
Esempio n. 4
0
 internal void Add(HiApplication app)
 {
     if (this.ht.Contains(app.Name))
     {
         throw new Exception(string.Format(CultureInfo.InvariantCulture, "The HiApplication.Name ({0}) was not unique", new object[] { app.Name }));
     }
     this.ht.Add(app.Name, app);
     this.keys.Add(app.Name);
 }