Message.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // System.Web.Services.Description.Message.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. using System.Collections;
  10. using System.Web.Services;
  11. using System.Xml.Serialization;
  12. namespace System.Web.Services.Description {
  13. public sealed class Message : DocumentableItem {
  14. #region Fields
  15. string name;
  16. MessagePartCollection parts;
  17. ServiceDescription serviceDescription;
  18. #endregion // Fields
  19. #region Constructors
  20. public Message ()
  21. {
  22. name = String.Empty;
  23. parts = new MessagePartCollection (this);
  24. serviceDescription = null;
  25. }
  26. #endregion // Constructors
  27. #region Properties
  28. [XmlAttribute ("name", DataType = "NCName")]
  29. public string Name {
  30. get { return name; }
  31. set { name = value; }
  32. }
  33. [XmlElement ("part")]
  34. public MessagePartCollection Parts {
  35. get { return parts; }
  36. }
  37. public ServiceDescription ServiceDescription {
  38. get { return serviceDescription; }
  39. }
  40. #endregion // Properties
  41. #region Methods
  42. [MonoTODO]
  43. public MessagePart FindPartByName (string partName)
  44. {
  45. throw new NotImplementedException ();
  46. }
  47. [MonoTODO]
  48. public MessagePart[] FindPartsByName (string[] partNames)
  49. {
  50. ArrayList searchResults = new ArrayList ();
  51. foreach (string partName in partNames)
  52. searchResults.Add (FindPartByName (partName));
  53. int count = searchResults.Count;
  54. if (count == 0)
  55. throw new ArgumentException ();
  56. MessagePart[] returnValue = new MessagePart[count];
  57. searchResults.CopyTo (returnValue);
  58. return returnValue;
  59. }
  60. internal void SetParent (ServiceDescription serviceDescription)
  61. {
  62. this.serviceDescription = serviceDescription;
  63. }
  64. #endregion
  65. }
  66. }