PropertyCollection.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //------------------------------------------------------------------------------
  2. // <copyright file="PropertyCollection.cs" company="Microsoft">
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. // </copyright>
  5. // <owner current="true" primary="true">[....]</owner>
  6. // <owner current="true" primary="false">[....]</owner>
  7. // <owner current="false" primary="false">[....]</owner>
  8. //------------------------------------------------------------------------------
  9. namespace System.Data {
  10. using System;
  11. using System.Collections;
  12. using System.Runtime.Serialization;
  13. /// <devdoc>
  14. /// <para>Represents a collection of properties that can be added to <see cref='System.Data.DataColumn'/>,
  15. /// <see cref='System.Data.DataSet'/>,
  16. /// or <see cref='System.Data.DataTable'/>.</para>
  17. /// </devdoc>
  18. [Serializable]
  19. public class PropertyCollection : Hashtable {
  20. public PropertyCollection() : base() {
  21. }
  22. protected PropertyCollection(SerializationInfo info, StreamingContext context) : base(info, context) {
  23. }
  24. public override object Clone() {
  25. // override Clone so that returned object is an
  26. // instance of PropertyCollection instead of Hashtable
  27. PropertyCollection clone = new PropertyCollection();
  28. foreach (DictionaryEntry pair in this) {
  29. clone.Add(pair.Key, pair.Value);
  30. }
  31. return clone;
  32. }
  33. }
  34. //3 NOTE: This should have been named PropertyDictionary, to avoid fxcop warnings about not having strongly typed IList and ICollection implementations, but it's too late now...
  35. }