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.

124 lines
2.3 KiB

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