EncryptionProperties.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. //
  2. // EncryptionProperties.cs - EncryptionProperties implementation for XML Encryption
  3. // http://www.w3.org/2001/04/xmlenc#sec-EncryptionProperties
  4. //
  5. // Author:
  6. // Tim Coleman ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2004
  9. //
  10. // Permission is hereby granted, free of charge, to any person obtaining
  11. // a copy of this software and associated documentation files (the
  12. // "Software"), to deal in the Software without restriction, including
  13. // without limitation the rights to use, copy, modify, merge, publish,
  14. // distribute, sublicense, and/or sell copies of the Software, and to
  15. // permit persons to whom the Software is furnished to do so, subject to
  16. // the following conditions:
  17. //
  18. // The above copyright notice and this permission notice shall be
  19. // included in all copies or substantial portions of the Software.
  20. //
  21. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28. //
  29. #if NET_2_0
  30. using System.Collections;
  31. using System.Xml;
  32. namespace System.Security.Cryptography.Xml {
  33. public sealed class EncryptionPropertyCollection : IList, ICollection, IEnumerable {
  34. #region Fields
  35. ArrayList list;
  36. #endregion // Fields
  37. #region Constructors
  38. public EncryptionPropertyCollection ()
  39. {
  40. list = new ArrayList ();
  41. }
  42. #endregion // Constructors
  43. #region Properties
  44. public int Count {
  45. get { return list.Count; }
  46. }
  47. public bool IsFixedSize {
  48. get { return list.IsFixedSize; }
  49. }
  50. public bool IsReadOnly {
  51. get { return list.IsReadOnly; }
  52. }
  53. public bool IsSynchronized {
  54. get { return list.IsSynchronized; }
  55. }
  56. object IList.this [int index] {
  57. get { return this [index]; }
  58. set { this [index] = (EncryptionProperty) value; }
  59. }
  60. public EncryptionProperty this [int index] {
  61. get { return (EncryptionProperty) list [index]; }
  62. set { list [index] = value; }
  63. }
  64. public object SyncRoot {
  65. get { return list.SyncRoot; }
  66. }
  67. #endregion // Properties
  68. #region Methods
  69. public int Add (EncryptionProperty value)
  70. {
  71. return list.Add (value);
  72. }
  73. public void Clear ()
  74. {
  75. list.Clear ();
  76. }
  77. public bool Contains (EncryptionProperty value)
  78. {
  79. return list.Contains (value);
  80. }
  81. public void CopyTo (Array array, int index)
  82. {
  83. list.CopyTo (array, index);
  84. }
  85. public void CopyTo (EncryptionProperty[] array, int index)
  86. {
  87. list.CopyTo (array, index);
  88. }
  89. public IEnumerator GetEnumerator ()
  90. {
  91. return list.GetEnumerator ();
  92. }
  93. bool IList.Contains (object value)
  94. {
  95. return Contains ((EncryptionProperty) value);
  96. }
  97. int IList.Add (object value)
  98. {
  99. return Add ((EncryptionProperty) value);
  100. }
  101. int IList.IndexOf (object value)
  102. {
  103. return IndexOf ((EncryptionProperty) value);
  104. }
  105. void IList.Insert (int index, object value)
  106. {
  107. Insert (index, (EncryptionProperty) value);
  108. }
  109. void IList.Remove (object value)
  110. {
  111. Remove ((EncryptionProperty) value);
  112. }
  113. public int IndexOf (EncryptionProperty value)
  114. {
  115. return list.IndexOf (value);
  116. }
  117. public void Insert (int index, EncryptionProperty value)
  118. {
  119. list.Insert (index, value);
  120. }
  121. public void Remove (EncryptionProperty value)
  122. {
  123. list.Remove (value);
  124. }
  125. public void RemoveAt (int index)
  126. {
  127. list.RemoveAt (index);
  128. }
  129. #endregion // Methods
  130. }
  131. }
  132. #endif