2
0

ContextAddressHeader.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.ServiceModel.Channels
  5. {
  6. using System.Collections.Generic;
  7. using System.Runtime;
  8. using System.Xml;
  9. class ContextAddressHeader : AddressHeader
  10. {
  11. ContextDictionary context;
  12. public ContextAddressHeader(IDictionary<string, string> context)
  13. : base()
  14. {
  15. Fx.Assert(context != null, "caller must validate");
  16. this.context = new ContextDictionary(context);
  17. }
  18. public override string Name
  19. {
  20. get { return ContextMessageHeader.ContextHeaderName; }
  21. }
  22. public override string Namespace
  23. {
  24. get { return ContextMessageHeader.ContextHeaderNamespace; }
  25. }
  26. protected override void OnWriteAddressHeaderContents(XmlDictionaryWriter writer)
  27. {
  28. ContextMessageHeader.WriteHeaderContents(writer, this.context);
  29. }
  30. }
  31. }