PageRenderTime 33ms CodeModel.GetById 9ms RepoModel.GetById 1ms app.codeStats 0ms

/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataRow.cs

https://bitbucket.org/danipen/mono
C# | 146 lines | 89 code | 29 blank | 28 comment | 1 complexity | 044f4ab0e4f6d1b4519e53da92aa200b 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. // Mono.Data.Tds.Protocol.TdsDataRow.cs
  3. //
  4. // Author:
  5. // Tim Coleman (tim@timcoleman.com)
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  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. using System;
  30. using System.Collections;
  31. namespace Mono.Data.Tds.Protocol {
  32. public class TdsDataRow : IList, ICollection, IEnumerable
  33. {
  34. #region Fields
  35. ArrayList list;
  36. int bigDecimalIndex;
  37. #endregion // Fields
  38. #region Constructors
  39. public TdsDataRow ()
  40. {
  41. list = new ArrayList ();
  42. bigDecimalIndex = -1;
  43. }
  44. #endregion // Constructors
  45. #region Properties
  46. public int BigDecimalIndex {
  47. get { return bigDecimalIndex; }
  48. set { bigDecimalIndex = value; }
  49. }
  50. public int Count {
  51. get { return list.Count; }
  52. }
  53. public bool IsFixedSize {
  54. get { return false; }
  55. }
  56. public bool IsReadOnly {
  57. get { return false; }
  58. }
  59. public bool IsSynchronized {
  60. get { return list.IsSynchronized; }
  61. }
  62. public object SyncRoot {
  63. get { return list.SyncRoot; }
  64. }
  65. public object this[int index] {
  66. get {
  67. if (index >= list.Count)
  68. throw new IndexOutOfRangeException ();
  69. return list[index];
  70. }
  71. set { list[index] = value; }
  72. }
  73. #endregion // Properties
  74. #region Methods
  75. public int Add (object value)
  76. {
  77. return list.Add (value);
  78. }
  79. public void Clear ()
  80. {
  81. list.Clear ();
  82. }
  83. public bool Contains (object value)
  84. {
  85. return list.Contains (value);
  86. }
  87. public void CopyTo (Array array, int index)
  88. {
  89. list.CopyTo (array, index);
  90. }
  91. public void CopyTo (int index, Array array, int arrayIndex, int count)
  92. {
  93. list.CopyTo (index, array, arrayIndex, count);
  94. }
  95. public IEnumerator GetEnumerator ()
  96. {
  97. return list.GetEnumerator ();
  98. }
  99. public int IndexOf (object value)
  100. {
  101. return list.IndexOf (value);
  102. }
  103. public void Insert (int index, object value)
  104. {
  105. list.Insert (index, value);
  106. }
  107. public void Remove (object value)
  108. {
  109. list.Remove (value);
  110. }
  111. public void RemoveAt (int index)
  112. {
  113. list.RemoveAt (index);
  114. }
  115. #endregion // Methods
  116. }
  117. }