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