DuplexClientBase.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.ServiceModel
  5. {
  6. using System.ServiceModel.Channels;
  7. using System.ServiceModel.Description;
  8. public abstract class DuplexClientBase<TChannel> : ClientBase<TChannel>
  9. where TChannel : class
  10. {
  11. // IMPORTANT: any changes to the set of protected .ctors of this class need to be reflected
  12. // in ServiceContractGenerator.cs as well.
  13. protected DuplexClientBase(object callbackInstance)
  14. : this(new InstanceContext(callbackInstance))
  15. {
  16. }
  17. protected DuplexClientBase(object callbackInstance, string endpointConfigurationName)
  18. : this(new InstanceContext(callbackInstance), endpointConfigurationName)
  19. {
  20. }
  21. protected DuplexClientBase(object callbackInstance, string endpointConfigurationName, string remoteAddress)
  22. : this(new InstanceContext(callbackInstance), endpointConfigurationName, remoteAddress)
  23. {
  24. }
  25. protected DuplexClientBase(object callbackInstance, string endpointConfigurationName, EndpointAddress remoteAddress)
  26. : this(new InstanceContext(callbackInstance), endpointConfigurationName, remoteAddress)
  27. {
  28. }
  29. protected DuplexClientBase(object callbackInstance, Binding binding, EndpointAddress remoteAddress)
  30. : this(new InstanceContext(callbackInstance), binding, remoteAddress)
  31. {
  32. }
  33. protected DuplexClientBase(object callbackInstance, ServiceEndpoint endpoint)
  34. : this(new InstanceContext(callbackInstance), endpoint)
  35. {
  36. }
  37. protected DuplexClientBase(InstanceContext callbackInstance)
  38. : base(callbackInstance)
  39. {
  40. }
  41. protected DuplexClientBase(InstanceContext callbackInstance, string endpointConfigurationName)
  42. : base(callbackInstance, endpointConfigurationName)
  43. {
  44. }
  45. protected DuplexClientBase(InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress)
  46. : base(callbackInstance, endpointConfigurationName, remoteAddress)
  47. {
  48. }
  49. protected DuplexClientBase(InstanceContext callbackInstance, string endpointConfigurationName, EndpointAddress remoteAddress)
  50. : base(callbackInstance, endpointConfigurationName, remoteAddress)
  51. {
  52. }
  53. protected DuplexClientBase(InstanceContext callbackInstance, Binding binding, EndpointAddress remoteAddress)
  54. : base(callbackInstance, binding, remoteAddress)
  55. {
  56. }
  57. protected DuplexClientBase(InstanceContext callbackInstance, ServiceEndpoint endpoint)
  58. : base(callbackInstance, endpoint)
  59. {
  60. }
  61. public IDuplexContextChannel InnerDuplexChannel
  62. {
  63. get
  64. {
  65. return (IDuplexContextChannel)InnerChannel;
  66. }
  67. }
  68. }
  69. }