Exemplo n.º 1
0
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public object Clone()
        {
            var collection = new KeyValueCollection();

            foreach (var item in _items)
            {
                collection.Add(item.Key, item.Value);
            }
            return(collection);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Contact"/> class.
 /// </summary>
 /// <param name="value">contact to deep clone.</param>
 public Contact(Contact value)
 {
     Name       = value.Name;
     Uri        = value.Uri;
     Parameters = new KeyValueCollection();
     foreach (var parameter in value.Parameters)
     {
         Parameters.Add(parameter.Key, parameter.Value);
     }
 }