PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/mcs/class/System.Security/System.Security.Cryptography.Xml/EncryptionProperties.cs

https://bitbucket.org/danipen/mono
C# | 177 lines | 110 code | 38 blank | 29 comment | 0 complexity | fb6750a13787d61a6489cc61665bef74 MD5 | raw file
Possible License(s): Unlicense, Apache-2.0, LGPL-2.0, MPL-2.0-no-copyleft-exception, CC-BY-SA-3.0, GPL-2.0
  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 (tim@timcoleman.com)
  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. #if NET_2_0
  31. using System.Collections;
  32. using System.Runtime.CompilerServices;
  33. using System.Xml;
  34. namespace System.Security.Cryptography.Xml {
  35. public sealed class EncryptionPropertyCollection : IList, ICollection, IEnumerable {
  36. #region Fields
  37. ArrayList list;
  38. #endregion // Fields
  39. #region Constructors
  40. public EncryptionPropertyCollection ()
  41. {
  42. list = new ArrayList ();
  43. }
  44. #endregion // Constructors
  45. #region Properties
  46. public int Count {
  47. get { return list.Count; }
  48. }
  49. public bool IsFixedSize {
  50. get { return list.IsFixedSize; }
  51. }
  52. public bool IsReadOnly {
  53. get { return list.IsReadOnly; }
  54. }
  55. public bool IsSynchronized {
  56. get { return list.IsSynchronized; }
  57. }
  58. object IList.this [int index] {
  59. get { return this [index]; }
  60. set { this [index] = (EncryptionProperty) value; }
  61. }
  62. [IndexerName ("ItemOf")]
  63. public EncryptionProperty this [int index] {
  64. get { return (EncryptionProperty) list [index]; }
  65. set { list [index] = value; }
  66. }
  67. public object SyncRoot {
  68. get { return list.SyncRoot; }
  69. }
  70. #endregion // Properties
  71. #region Methods
  72. public int Add (EncryptionProperty value)
  73. {
  74. return list.Add (value);
  75. }
  76. public void Clear ()
  77. {
  78. list.Clear ();
  79. }
  80. public bool Contains (EncryptionProperty value)
  81. {
  82. return list.Contains (value);
  83. }
  84. public void CopyTo (Array array, int index)
  85. {
  86. list.CopyTo (array, index);
  87. }
  88. public void CopyTo (EncryptionProperty[] array, int index)
  89. {
  90. list.CopyTo (array, index);
  91. }
  92. public IEnumerator GetEnumerator ()
  93. {
  94. return list.GetEnumerator ();
  95. }
  96. bool IList.Contains (object value)
  97. {
  98. return Contains ((EncryptionProperty) value);
  99. }
  100. int IList.Add (object value)
  101. {
  102. return Add ((EncryptionProperty) value);
  103. }
  104. int IList.IndexOf (object value)
  105. {
  106. return IndexOf ((EncryptionProperty) value);
  107. }
  108. void IList.Insert (int index, object value)
  109. {
  110. Insert (index, (EncryptionProperty) value);
  111. }
  112. void IList.Remove (object value)
  113. {
  114. Remove ((EncryptionProperty) value);
  115. }
  116. public int IndexOf (EncryptionProperty value)
  117. {
  118. return list.IndexOf (value);
  119. }
  120. public void Insert (int index, EncryptionProperty value)
  121. {
  122. list.Insert (index, value);
  123. }
  124. public EncryptionProperty Item (int index)
  125. {
  126. return (EncryptionProperty) list [index];
  127. }
  128. public void Remove (EncryptionProperty value)
  129. {
  130. list.Remove (value);
  131. }
  132. public void RemoveAt (int index)
  133. {
  134. list.RemoveAt (index);
  135. }
  136. #endregion // Methods
  137. }
  138. }
  139. #endif