/// <summary> /// Initializes new instance of this type. /// </summary> /// <param name="source">The source to copy into this collection.</param> public ExtensionCollection(IExtensionCollection source) : this() { ArgumentValidator.EnsureArgumentNotNull(source, "source"); if (source.Count == 0) { return; } var sourceLikeMe = source as ExtensionCollection; if (sourceLikeMe != null) { extensions = new Dictionary <Type, object>(sourceLikeMe.extensions); } else { foreach (Type extensionType in source) { Set(extensionType, source.Get(extensionType)); } } }