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.

122 lines
2.1 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 Name : UddiCore
  8. {
  9. private string isoLanguageCode;
  10. private string text;
  11. public Name() : this( "", "" )
  12. {}
  13. public Name( string name ) : this( "en", name )
  14. {}
  15. public Name( string languageCode, string name )
  16. {
  17. IsoLanguageCode = languageCode;
  18. Text = name;
  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 NameCollection : CollectionBase
  34. {
  35. public Name this[ int index ]
  36. {
  37. get { return (Name)List[ index ]; }
  38. set { List[ index ] = value; }
  39. }
  40. public int Add( Name value )
  41. {
  42. return List.Add( value );
  43. }
  44. public int Add( string value )
  45. {
  46. return List.Add( new Name( value ) );
  47. }
  48. public int Add( string langCode, string name )
  49. {
  50. return List.Add( new Name( langCode, name ) );
  51. }
  52. public void Insert( int index, Name value )
  53. {
  54. List.Insert( index, value );
  55. }
  56. public int IndexOf( Name value )
  57. {
  58. return List.IndexOf( value );
  59. }
  60. public bool Contains( Name value )
  61. {
  62. return List.Contains( value );
  63. }
  64. public void Remove( Name value )
  65. {
  66. List.Remove( value );
  67. }
  68. public void CopyTo( Name[] array, int index )
  69. {
  70. List.CopyTo( array, index );
  71. }
  72. public new NameEnumerator GetEnumerator()
  73. {
  74. return new NameEnumerator( List.GetEnumerator() );
  75. }
  76. }
  77. public sealed class NameEnumerator : IEnumerator
  78. {
  79. private IEnumerator enumerator;
  80. public NameEnumerator( IEnumerator enumerator )
  81. {
  82. this.enumerator = enumerator;
  83. }
  84. public Name Current
  85. {
  86. get { return ( Name ) 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. }