Esempio n. 1
0
 private Type FindType(string url)
 {
     url = ResolveUrl(url);
     if (!string.IsNullOrEmpty(url))
     {
         Type result;
         MappingCollection mappings = this.Mappings;
         if (mappings.TryGetValue(url, out result))
         {
             return(result);
         }
     }
     return(null);
 }
Esempio n. 2
0
        public virtual void Add(string url, Type type)
        {
            url = ResolveUrl(url);
            if (!string.IsNullOrEmpty(url) && type != null)
            {
                MappingCollection mappings = this.Mappings;

                if (mappings != null)
                {
                    Type newType = null;
                    mappings.TryGetValue(url, out newType);
                    if (newType != type)
                    {
                        lock (mappings)
                        {
                            mappings[url] = type;
                        }
                    }
                }
            }
        }