Example #1
0
        internal /*public*/ bool RemoveMapping(String requestType, String path)
        {
            bool found = false;

            for (int phase = 0; phase < 4; phase++)
            {
                ArrayList list;

                if (phase < 2)
                {
                    list = _phase[phase];
                }
                else
                {
                    list = _group[phase - 2];
                }

                if (list != null)
                {
                    int n = list.Count;

                    for (int i = 0; i < n; i++)
                    {
                        HandlerMapping m = (HandlerMapping)list[i];

                        if (m.IsPattern(requestType, path))
                        {
                            // inefficient if there are many matches

                            list.RemoveAt(i);
                            i--;
                            n--;
                            found = true;
                        }
                    }
                }
            }

            return(found);
        }