Exemple #1
0
        /// <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);
        }
Exemple #2
0
 /// <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();
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InterfaceTypeSet{V}"/> class.
 /// </summary>
 public InterfaceTypeSet()
 {
     _dictionary = new InterfaceTypeDictionary <V>();
 }