Exemplo n.º 1
0
 public void Remove(CacheEntry ce)
 {
     Remove(ce.Location);
 }
Exemplo n.º 2
0
 public void Add(CacheEntry newEntry)
 {
     CacheEntry e = this;
     while (e != null) {
         if (e == newEntry) {
             return;
         }
         if (e.location == newEntry.location) {
             e.schema = newEntry.schema;
             e.lastModified = newEntry.lastModified;
             e.disabled = newEntry.disabled;
             return;
         }
         if (e.next == null) {
             e.next = newEntry;
             break;
         }
         e = e.next;
     }
 }
Exemplo n.º 3
0
        public CacheEntry Add(string nsuri, Uri uri, bool disabled)
        {
            if (nsuri == null) nsuri = "";

            CacheEntry existing = null;
            CacheEntry e = null;

            if (namespaceMap.ContainsKey(nsuri)) {
                existing = namespaceMap[nsuri];
                e = existing.FindByUri(uri);
            }
            if (e == null) {
                e = new CacheEntry();
                e.Location = uri;
                e.TargetNamespace = nsuri;

                if (existing != null) {
                    existing.Add(e);
                } else {
                    namespaceMap[nsuri] = e;
                }
            }
            e.Disabled = disabled;
            if (uriMap.ContainsKey(uri)) {
                CacheEntry oe = (CacheEntry)uriMap[uri];
                if (oe != e) {
                    // target namespace must have changed!
                    nsuri = oe.TargetNamespace;
                    if (nsuri == null) nsuri = "";
                    if (namespaceMap.ContainsKey(nsuri)) {
                        namespaceMap.Remove(nsuri);
                    }
                }
            }
            uriMap[uri] = e;
            this.FireOnChanged();

            return e;
        }