Exemple #1
0
        void LoadXml(string filename)
        {
            idmax = -1;
            dict_url.Clear();
            dict_id.Clear();

            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
            doc.Load(filename);
            foreach (System.Xml.XmlElement elem in doc.GetElementsByTagName("favicon"))
            {
                FaviconData icon = new FaviconData();
                if (!int.TryParse(elem.GetAttribute("id"), out icon.id))
                {
                    continue;
                }
                icon.url  = elem.GetAttribute("url");
                icon.data = elem.GetAttribute("data");

                if (idmax < icon.id)
                {
                    idmax = icon.id;
                }
                dict_url[icon.url] = icon;
                dict_id[icon.id]   = icon;
            }
        }
Exemple #2
0
 public void Clear()
 {
     lock (map){
         foreach (block_t b in this.map.Values)
         {
             parent.FreeBlock(b);
         }
         map.Clear();
     }
 }
Exemple #3
0
 public void Dispose()
 {
     Sshfs.Program.Background -= this.bg_close;
     lock (times){
         foreach (string path in times.Keys)
         {
             try{ cache.Close(path); }catch {}
         }
         times.Clear();
     }
 }