IClientChannelSinkProvider Interface

Définition

Crée des récepteurs de canal client pour le canal client sur lequel circulent les messages de communication à distance.

public interface class IClientChannelSinkProvider
public interface IClientChannelSinkProvider
[System.Runtime.InteropServices.ComVisible(true)]
public interface IClientChannelSinkProvider
type IClientChannelSinkProvider = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type IClientChannelSinkProvider = interface
Public Interface IClientChannelSinkProvider
Dérivé
Attributs

Exemples

L’exemple de code suivant illustre une implémentation de cette interface.

[System::Security::Permissions::PermissionSet(System::Security::
   Permissions::SecurityAction::Demand, Name = "FullTrust")]
public ref class ClientSinkProvider: public IClientChannelSinkProvider
{
private:

   // The next provider in the chain.
   IClientChannelSinkProvider^ nextProvider;

public:
   property IClientChannelSinkProvider^ Next 
   {
      virtual IClientChannelSinkProvider^ get()
      {
         return (nextProvider);
      }

      virtual void set( IClientChannelSinkProvider^ value )
      {
         nextProvider = value;
      }
   }

   virtual IClientChannelSink^ CreateSink( IChannelSender^ channel, String^ url, Object^ remoteChannelData )
   {
      Console::WriteLine( "Creating ClientSink for {0}", url );
      
      // Create the next sink in the chain.
      IClientChannelSink^ nextSink = nextProvider->CreateSink( channel, url, remoteChannelData );
      
      // Hook our sink up to it.
      return (gcnew ClientSink( nextSink ));
   }

   // This constructor is required in order to use the provider in file-based configuration.
   // It need not do anything unless you want to use the information in the parameters.
   ClientSinkProvider( IDictionary^ /*properties*/, ICollection^ /*providerData*/ ){}
};
public class ClientSinkProvider : IClientChannelSinkProvider
{

    // The next provider in the chain.
    private IClientChannelSinkProvider nextProvider;

    public IClientChannelSinkProvider Next
    {
        get
        {
            return(nextProvider);
        }
        set
        {
            nextProvider = value;
        }
    }

    public IClientChannelSink CreateSink (IChannelSender channel, String url, Object remoteChannelData)
    {

        Console.WriteLine("Creating ClientSink for {0}", url);

        // Create the next sink in the chain.
        IClientChannelSink nextSink = nextProvider.CreateSink(channel, url, remoteChannelData);

        // Hook our sink up to it.
        return( new ClientSink(nextSink) );
    }

    // This constructor is required in order to use the provider in file-based configuration.
    // It need not do anything unless you want to use the information in the parameters.
    public ClientSinkProvider (IDictionary properties, ICollection providerData) {}
}

Consultez la documentation de l’interface IClientChannelSink pour obtenir un exemple d’implémentation de récepteur client correspondante.

Remarques

Les récepteurs de canal sont connectés à un canal client via des implémentations de l’interface IClientChannelSinkProvider . Tous les canaux clients de communication à distance fournissent des constructeurs qui prennent un IClientChannelSinkProvider paramètre.

Les fournisseurs de récepteurs de canal sont stockés dans une chaîne, et l’utilisateur est responsable du chaînage de tous les fournisseurs de récepteurs de canal avant de passer l’externe au constructeur de canal. IClientChannelSinkProvider fournit une propriété appelée Next à cet effet.

Lorsque plusieurs fournisseurs de récepteurs de canaux sont spécifiés dans un fichier de configuration, l’infrastructure de communication à distance les chaîne dans l’ordre dans lequel ils se trouvent dans le fichier de configuration. Les fournisseurs de récepteurs de canal sont créés lors de la création du canal pendant l’appel RemotingConfiguration.Configure .

Propriétés

Next

Obtient ou définit le fournisseur de récepteur suivant dans la chaîne de fournisseurs de récepteur de canal.

Méthodes

CreateSink(IChannelSender, String, Object)

Crée une chaîne de récepteurs.

S’applique à