예제 #1
0
 public void Add(UrlPrefix item)
 {
     lock (_prefixes)
     {
         var id = _nextId++;
         if (_urlGroup != null)
         {
             _urlGroup.RegisterPrefix(item.FullPrefix, id);
         }
         _prefixes.Add(id, item);
     }
 }
예제 #2
0
 internal void RegisterAllPrefixes(UrlGroup urlGroup)
 {
     lock (_prefixes)
     {
         _urlGroup = urlGroup;
         // go through the uri list and register for each one of them
         foreach (var pair in _prefixes)
         {
             // We'll get this index back on each request and use it to look up the prefix to calculate PathBase.
             _urlGroup.RegisterPrefix(pair.Value.FullPrefix, pair.Key);
         }
     }
 }