public void Prefetch(RememberDelegate function) { string section = "", entry = ""; object value; if (!File.Exists(filename)) { return; } using (XmlReader reader = XmlReader.Create(filename, GetReaderSettings())) { try { while (reader.Read()) { if (IsAtSection(reader)) { section = reader.GetAttribute("name"); } else if (IsAtEntry(reader)) { entry = reader.GetAttribute("name"); value = reader.ReadString(); function.Invoke(section, entry, value); } } } catch { return; } } }
public void Prefetch(RememberDelegate function) { function.Invoke("1234", "5678", 42); }