/// <inheritdoc/> ICloneable ICloneable.Clone() { var clone = new InterfaceTypeDictionary <V>(); foreach (var pair in _dictionary) { var cloneValue = pair.Value; if (pair.Value is ICloneable cloneable) { cloneValue = (V)cloneable.Clone(); } clone.Add(pair.Key, cloneValue); } return(clone); }
/// <summary> /// Initializes a new instance of the <see cref="InterfaceTypeSet{V}"/> class. /// </summary> /// <param name="original">The original.</param> protected InterfaceTypeSet(InterfaceTypeSet <V> original) { _dictionary = (InterfaceTypeDictionary <V>)((ICloneable)original._dictionary).Clone(); }
/// <summary> /// Initializes a new instance of the <see cref="InterfaceTypeSet{V}"/> class. /// </summary> public InterfaceTypeSet() { _dictionary = new InterfaceTypeDictionary <V>(); }