Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
Other versions are also available for the following:
.NET Framework Class Library for Silverlight
ClientBase<(Of <(TChannel>)>) Class

Provides the base implementation used to create Silverlight version 2 client objects that can call services.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
Visual Basic (Declaration)
Public MustInherit Class ClientBase(Of TChannel As Class) _
    Implements ICommunicationObject
Visual Basic (Usage)
Dim instance As ClientBase(Of TChannel)
C#
public abstract class ClientBase<TChannel> : ICommunicationObject
where TChannel : class

Type Parameters

TChannel

The channel to be used to connect to the service.

Extend the ClientBase<(Of <(TChannel>)>) class to create a custom Silverlight 2 client object that can be used to connect to a service.

The ClientBase<(Of <(TChannel>)>) class can be used quickly and easily by developers who prefer objects to the use of the interfaces and the System.ServiceModel..::.ChannelFactory<(Of <(TChannel>)>) class. In all cases this class wraps or exposes the methods and functionality of the System.ServiceModel..::.ChannelFactory<(Of <(TChannel>)>) class and the System.ServiceModel..::.IClientChannel interface.

As when using the System.ServiceModel..::.ServiceHost class, you can create the class and modify the endpoint, channel factory, or security information prior to making any calls or calling Open.

Special note for Managed C++ users deriving from this class:

  • Put your clean-up code in (On)(Begin)Close (and/or OnAbort), not in a destructor.

  • Avoid destructors: they cause the compiler to auto-generate IDisposable.

  • Avoid non-reference members: they can cause the compiler to auto-generate IDisposable.

  • Avoid finalizers; but if you include one, you should suppress the build warning and call SuppressFinalize(Object) and the finalizer itself from (On)(Begin)Close (and/or OnAbort) to emulate what would have been the auto-generated IDisposable behavior.

C#
//Derive a Silverlight client from the abstract ClientBase class.
public partial class SilverlightClient : System.ServiceModel.ClientBase<ChannelBase>
{

    public SilverlightClient()
    {
    }

    public SilverlightClient(string endpointConfigurationName) : 
            base(endpointConfigurationName)
    {
    }

    public SilverlightClient(string endpointConfigurationName, string remoteAddress) : 
            base(endpointConfigurationName, remoteAddress)
    {
    }

    public SilverlightClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(endpointConfigurationName, remoteAddress)
    {
    }

    public SilverlightClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(binding, remoteAddress)
    {
    }
}

System..::.Object
  System.ServiceModel..::.ClientBase<(Of <(TChannel>)>)
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker