Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
2.3 KiB

  1. using System;
  2. using System.Collections;
  3. using System.Diagnostics;
  4. using System.Xml.Serialization;
  5. namespace Microsoft.Uddi
  6. {
  7. public class Description : UddiCore
  8. {
  9. private string isoLanguageCode;
  10. private string text;
  11. public Description() : this( "", "" )
  12. {}
  13. public Description( string description ) : this( "en", description )
  14. {}
  15. public Description( string languageCode, string description )
  16. {
  17. IsoLanguageCode = languageCode;
  18. Text = description;
  19. }
  20. [XmlAttribute("xml:lang")]
  21. public string IsoLanguageCode
  22. {
  23. get { return isoLanguageCode; }
  24. set { isoLanguageCode = value; }
  25. }
  26. [XmlText]
  27. public string Text
  28. {
  29. get { return text; }
  30. set { text = value; }
  31. }
  32. }
  33. public class DescriptionCollection : CollectionBase
  34. {
  35. public Description this[int index]
  36. {
  37. get { return (Description)List[index]; }
  38. set { List[index] = value; }
  39. }
  40. public int Add(Description value)
  41. {
  42. return List.Add(value);
  43. }
  44. public int Add(string value)
  45. {
  46. return List.Add( new Description(value) );
  47. }
  48. public int Add(string langCode, string description)
  49. {
  50. return List.Add( new Description(langCode, description) );
  51. }
  52. public void Insert(int index, Description value)
  53. {
  54. List.Insert(index, value);
  55. }
  56. public int IndexOf(Description value)
  57. {
  58. return List.IndexOf(value);
  59. }
  60. public bool Contains(Description value)
  61. {
  62. return List.Contains(value);
  63. }
  64. public void Remove(Description value)
  65. {
  66. List.Remove(value);
  67. }
  68. public void CopyTo(Description[] array, int index)
  69. {
  70. List.CopyTo(array, index);
  71. }
  72. public new DescriptionEnumerator GetEnumerator()
  73. {
  74. return new DescriptionEnumerator( List.GetEnumerator() );
  75. }
  76. }
  77. public sealed class DescriptionEnumerator : IEnumerator
  78. {
  79. private IEnumerator enumerator;
  80. public DescriptionEnumerator( IEnumerator enumerator )
  81. {
  82. this.enumerator = enumerator;
  83. }
  84. public Description Current
  85. {
  86. get { return ( Description ) enumerator.Current; }
  87. }
  88. object IEnumerator.Current
  89. {
  90. get{ return enumerator.Current; }
  91. }
  92. public bool MoveNext()
  93. {
  94. return enumerator.MoveNext();
  95. }
  96. public void Reset()
  97. {
  98. enumerator.Reset();
  99. }
  100. }
  101. }