/// <summary>
        /// Update or fill the collection using the mapping entry
        /// </summary>
        private static void UpdateCollection(object currentValue, Type memberType, ICustomAttributeProvider attributeProvider, Entry rootEntry,
                                             ICollectionStrategy strategy, ICustomSerialization customSerialization)
        {
            var currentCollection = currentValue as ICollection;

            // Loop over the collection and update the entries that are still present
            if (currentCollection != null)
            {
                foreach (var key in strategy.Keys())
                {
                    var item  = strategy.ElementAt(key);
                    var match = rootEntry.SubEntries.Find(se => se.Identifier == key);
                    if (match == null)
                    {
                        strategy.Removed(key);
                        continue;
                    }

                    if (match.Value.Type < EntryValueType.Class)
                    {
                        item = CreatePrimitiveOrEnum(memberType, match.Value, customSerialization.FormatProvider);
                    }
                    else
                    {
                        UpdateInstance(item, match, customSerialization);
                    }
                    strategy.Updated(match, item);
                }
            }

            // Add new entries to the collection
            foreach (var subEntry in rootEntry.SubEntries.Where(se => se.Identifier == Entry.CreatedIdentifier))
            {
                object item;
                // All value types
                if (subEntry.Value.Type < EntryValueType.Class)
                {
                    // Create value type
                    item = CreatePrimitiveOrEnum(memberType, subEntry.Value, customSerialization.FormatProvider);
                }
                else
                {
                    // Create and update reference types
                    item = customSerialization.CreateInstance(memberType, attributeProvider, subEntry);
                    item = UpdateInstance(item, subEntry, customSerialization);
                }
                strategy.Added(subEntry, item);
            }

            // Finalize all operations
            strategy.Flush();
        }
        /// <summary>
        /// Create object instance from config model using entry for specialized types
        /// </summary>
        public static object CreateInstance(Type type, Entry encoded, ICustomSerialization customSerialization)
        {
            var instance = customSerialization.CreateInstance(type, encoded);

            return(UpdateInstance(instance, encoded, customSerialization));
        }