PeerCustomResolverSettings.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.ServiceModel.PeerResolvers
  5. {
  6. using System;
  7. using System.ServiceModel;
  8. using System.ServiceModel.Description;
  9. using System.Collections.Generic;
  10. using System.Collections.ObjectModel;
  11. using System.Configuration;
  12. using System.Globalization;
  13. using System.Net.Security;
  14. using System.ServiceModel.Configuration;
  15. using System.ServiceModel.Channels;
  16. public class PeerCustomResolverSettings
  17. {
  18. EndpointAddress address;
  19. Binding binding;
  20. string bindingSection, bindingConfiguration;
  21. PeerResolver resolver;
  22. public PeerCustomResolverSettings() { }
  23. public EndpointAddress Address
  24. {
  25. get
  26. {
  27. return address;
  28. }
  29. set
  30. {
  31. address = value;
  32. }
  33. }
  34. public Binding Binding
  35. {
  36. get
  37. {
  38. if (binding == null)
  39. {
  40. if (!String.IsNullOrEmpty(this.bindingSection) && !String.IsNullOrEmpty(this.bindingConfiguration))
  41. binding = ConfigLoader.LookupBinding(this.bindingSection, this.bindingConfiguration);
  42. }
  43. return binding;
  44. }
  45. set
  46. {
  47. binding = value;
  48. }
  49. }
  50. public bool IsBindingSpecified
  51. {
  52. get
  53. {
  54. return ((this.binding != null) || (!String.IsNullOrEmpty(this.bindingSection) && !String.IsNullOrEmpty(this.bindingConfiguration)));
  55. }
  56. }
  57. public PeerResolver Resolver
  58. {
  59. get
  60. {
  61. return resolver;
  62. }
  63. set
  64. {
  65. resolver = value;
  66. }
  67. }
  68. internal string BindingSection
  69. {
  70. get
  71. {
  72. return bindingSection;
  73. }
  74. set
  75. {
  76. bindingSection = value;
  77. }
  78. }
  79. internal string BindingConfiguration
  80. {
  81. get
  82. {
  83. return bindingConfiguration;
  84. }
  85. set
  86. {
  87. bindingConfiguration = value;
  88. }
  89. }
  90. }
  91. }