MessageBodyDescription.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. using System;
  5. using System.ServiceModel.Channels;
  6. using System.Collections.Generic;
  7. using System.Text;
  8. using System.Runtime.Serialization;
  9. using System.ComponentModel;
  10. namespace System.ServiceModel.Description
  11. {
  12. public class MessageBodyDescription
  13. {
  14. private XmlName wrapperName;
  15. private string wrapperNs;
  16. private MessagePartDescriptionCollection parts;
  17. private MessagePartDescription returnValue;
  18. public MessageBodyDescription()
  19. {
  20. parts = new MessagePartDescriptionCollection();
  21. }
  22. internal MessageBodyDescription(MessageBodyDescription other)
  23. {
  24. this.WrapperName = other.WrapperName;
  25. this.WrapperNamespace = other.WrapperNamespace;
  26. this.parts = new MessagePartDescriptionCollection();
  27. foreach (MessagePartDescription mpd in other.Parts)
  28. {
  29. this.Parts.Add(mpd.Clone());
  30. }
  31. if (other.ReturnValue != null)
  32. {
  33. this.ReturnValue = other.ReturnValue.Clone();
  34. }
  35. }
  36. internal MessageBodyDescription Clone()
  37. {
  38. return new MessageBodyDescription(this);
  39. }
  40. public MessagePartDescriptionCollection Parts
  41. {
  42. get { return parts; }
  43. }
  44. [DefaultValue(null)]
  45. public MessagePartDescription ReturnValue
  46. {
  47. get { return returnValue; }
  48. set { returnValue = value; }
  49. }
  50. [DefaultValue(null)]
  51. public string WrapperName
  52. {
  53. get { return wrapperName == null ? null : wrapperName.EncodedName; }
  54. set { wrapperName = new XmlName(value, true /*isEncoded*/); }
  55. }
  56. [DefaultValue(null)]
  57. public string WrapperNamespace
  58. {
  59. get { return wrapperNs; }
  60. set { wrapperNs = value; }
  61. }
  62. }
  63. }