Exemple #1
0
        /// <summary>
        /// Gets items that are missing.
        /// </summary>
        /// <param name="find"></param>
        /// <returns></returns>
        protected IDictionary GetMissingItems(IDictionary find)
        {
            if (find == null)
            {
                throw new ArgumentNullException("find");
            }

            // does the table exist?
            IDictionary results = CollectionsUtil.CreateCaseInsensitiveHashtable();

            if (ConfigItem.DoesTableExist())
            {
                // find it...
                foreach (DictionaryEntry entry in find)
                {
                    string name = (string)entry.Key;

                    // existing?
                    ConfigItem item = ConfigItem.GetByName(name);
                    if (item == null)
                    {
                        results[name] = entry.Value;
                    }
                }
            }
            else
            {
                // copy it...
                foreach (DictionaryEntry entry in find)
                {
                    results[entry.Key] = entry.Value;
                }
            }

            // return...
            return(results);
        }