Beispiel #1
0
        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);
                }
            }
        }
Beispiel #2
0
 public void RemoveItem(InfoBarItem item)
 {
     infoBarItems.Remove(item);
 }
Beispiel #3
0
 public void AddItem(InfoBarItem ibi)
 {
     infoBarItems.Add(ibi);
 }