MessageHeaderDescription.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.ServiceModel.Description
  5. {
  6. using System;
  7. using System.ServiceModel.Channels;
  8. using System.ServiceModel;
  9. using System.Xml;
  10. using System.Collections.Generic;
  11. using System.Text;
  12. using System.Runtime.Serialization;
  13. using System.ComponentModel;
  14. public class MessageHeaderDescription : MessagePartDescription
  15. {
  16. bool mustUnderstand;
  17. bool relay;
  18. string actor;
  19. bool typedHeader;
  20. bool isUnknownHeader;
  21. public MessageHeaderDescription(string name, string ns)
  22. : base(name, ns)
  23. {
  24. }
  25. internal MessageHeaderDescription(MessageHeaderDescription other)
  26. : base(other)
  27. {
  28. this.MustUnderstand = other.MustUnderstand;
  29. this.Relay = other.Relay;
  30. this.Actor = other.Actor;
  31. this.TypedHeader = other.TypedHeader;
  32. this.IsUnknownHeaderCollection = other.IsUnknownHeaderCollection;
  33. }
  34. internal override MessagePartDescription Clone()
  35. {
  36. return new MessageHeaderDescription(this);
  37. }
  38. [DefaultValue(null)]
  39. public string Actor
  40. {
  41. get { return this.actor; }
  42. set { this.actor = value; }
  43. }
  44. [DefaultValue(false)]
  45. public bool MustUnderstand
  46. {
  47. get { return this.mustUnderstand; }
  48. set { this.mustUnderstand = value; }
  49. }
  50. [DefaultValue(false)]
  51. public bool Relay
  52. {
  53. get { return this.relay; }
  54. set { this.relay = value; }
  55. }
  56. [DefaultValue(false)]
  57. public bool TypedHeader
  58. {
  59. get { return this.typedHeader; }
  60. set { this.typedHeader = value; }
  61. }
  62. internal bool IsUnknownHeaderCollection
  63. {
  64. get
  65. {
  66. return isUnknownHeader || Multiple && (Type == typeof(XmlElement));
  67. }
  68. set
  69. {
  70. isUnknownHeader = value;
  71. }
  72. }
  73. }
  74. }