// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
-// Copyright (C) 2005 Novell, Inc. http://www.novell.com
+// Copyright (C) 2005,2009 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System;
using System.Collections.Generic;
using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
namespace System.ServiceModel
{
- public class DuplexClientBase<TChannel> : ClientBase<TChannel>
+ public class DuplexClientBase<TChannel> : ClientBase<TChannel> where TChannel : class
{
- protected DuplexClientBase (InstanceContext instance)
- : this (instance, (Binding) null, null)
+ protected DuplexClientBase (object callbackInstance)
+ : this (new InstanceContext (callbackInstance), (Binding) null, null)
{
}
- protected DuplexClientBase (InstanceContext instance,
- Binding binding, EndpointAddress address)
+ protected DuplexClientBase (object callbackInstance,
+ Binding binding, EndpointAddress remoteAddress)
+ : this (new InstanceContext (callbackInstance), binding, remoteAddress)
{
- throw new NotImplementedException ();
}
- protected DuplexClientBase (InstanceContext instance,
- string configurationName)
+ protected DuplexClientBase (object callbackInstance,
+ string endpointConfigurationName)
+ : this (new InstanceContext (callbackInstance), endpointConfigurationName)
{
- throw new NotImplementedException ();
}
- protected DuplexClientBase (InstanceContext instance,
- string configurationName, EndpointAddress address)
+ protected DuplexClientBase (object callbackInstance,
+ string bindingConfigurationName, EndpointAddress remoteAddress)
+ : this (new InstanceContext (callbackInstance), bindingConfigurationName, remoteAddress)
+ {
+ }
+
+ protected DuplexClientBase (object callbackInstance,
+ string endpointConfigurationName, string remoteAddress)
+ : this (new InstanceContext (callbackInstance), endpointConfigurationName, remoteAddress)
+ {
+ }
+
+ protected DuplexClientBase (InstanceContext callbackInstance)
+ : base (callbackInstance)
+ {
+ }
+
+ protected DuplexClientBase (InstanceContext callbackInstance,
+ Binding binding, EndpointAddress remoteAddress)
+ : base (callbackInstance, binding, remoteAddress)
+ {
+ }
+
+ protected DuplexClientBase (InstanceContext callbackInstance,
+ string endpointConfigurationName)
+ : base (callbackInstance, endpointConfigurationName)
+ {
+ }
+
+ protected DuplexClientBase (InstanceContext callbackInstance,
+ string endpointConfigurationName, string remoteAddress)
+ : base (callbackInstance, endpointConfigurationName, remoteAddress)
+ {
+ }
+
+ protected DuplexClientBase (InstanceContext callbackInstance,
+ string endpointConfigurationName, EndpointAddress address)
+ : base (callbackInstance, endpointConfigurationName, address)
+ {
+ }
+
+ protected DuplexClientBase (object callbackInstance, ServiceEndpoint endpoint)
+ : this (new InstanceContext (callbackInstance), endpoint)
+ {
+ }
+
+ protected DuplexClientBase (InstanceContext callbackInstance, ServiceEndpoint endpoint)
+ : base (callbackInstance, endpoint)
{
- throw new NotImplementedException ();
}
public IDuplexContextChannel InnerDuplexChannel {
- get { throw new NotImplementedException (); }
+ get { return (IDuplexContextChannel) base.InnerChannel; }
+ }
+
+ internal override void Initialize (InstanceContext instance,
+ string endpointConfigurationName, EndpointAddress remoteAddress)
+ {
+ ChannelFactory = new DuplexChannelFactory<TChannel> (instance, endpointConfigurationName, remoteAddress);
+ }
+
+ internal override void Initialize (InstanceContext instance,
+ Binding binding, EndpointAddress remoteAddress)
+ {
+ ChannelFactory = new DuplexChannelFactory<TChannel> (instance, binding, remoteAddress);
}
protected override TChannel CreateChannel ()
{
- throw new NotImplementedException ();
+ return ChannelFactory.CreateChannel ();
}
}
}