EncryptionProperties.cs 3.8 KB

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