Esempio n. 1
0
        /// <summary>
        /// Returns false if the entry already exists
        /// </summary>
        /// <param name="entry"></param>
        /// <returns></returns>
        public bool AddEntry(SettingsEntry entry)
        {
            var type = entry.GetType();

            if (EntryExists(type))
            {
                return(false);
            }

            m_entries.Add(entry);
            return(true);
        }
Esempio n. 2
0
        public bool AddOrSetEntry(SettingsEntry entry)
        {
            var type = entry.GetType();

            if (EntryExists(type))
            {
                if (!RemoveEntry(type))
                {
                    throw new Exception(string.Format("Entry {0} already exists but cannot be removed for an unknow reason", type));
                }
            }


            m_entries.Add(entry);
            return(true);
        }