public void Load() { string path = Path.Combine(ProfileManager.ProfilePath, "infobar.xml"); if (!File.Exists(path)) { CreateDefault(); Save(); return; } XmlDocument doc = new XmlDocument(); try { doc.Load(path); } catch (Exception ex) { Log.Error(ex.ToString()); return; } infoBarItems.Clear(); XmlElement root = doc["infos"]; if (root != null) { foreach (XmlElement xml in root.GetElementsByTagName("info")) { InfoBarItem item = new InfoBarItem(xml); infoBarItems.Add(item); } } }
public void RemoveItem(InfoBarItem item) { infoBarItems.Remove(item); }
public void AddItem(InfoBarItem ibi) { infoBarItems.Add(ibi); }