Share via


IClientChannelSinkProvider Rozhraní

Definice

Vytvoří jímky klientského kanálu pro kanál klienta, kterým procházejí zprávy vzdálené komunikace.

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
Odvozené
Atributy

Příklady

Následující příklad kódu znázorňuje implementaci tohoto rozhraní.

[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) {}
}

Příklad implementace odpovídající klientské jímky najdete v IClientChannelSink dokumentaci k rozhraní.

Poznámky

Jímky kanálů jsou připojeny ke klientskému kanálu prostřednictvím implementací IClientChannelSinkProvider rozhraní. Všechny kanály klientů vzdálené komunikace poskytují konstruktory, které jako parametr přebírají IClientChannelSinkProvider .

Poskytovatelé jímky kanálů jsou uloženi v řetězu a uživatel zodpovídá za zřetězení všech poskytovatelů jímky kanálů před předáním vnějšího zprostředkovatele do konstruktoru kanálu. IClientChannelSinkProvider poskytuje vlastnost, která je pro tento účel volána Next .

Pokud je v konfiguračním souboru zadáno více poskytovatelů jímky kanálů, infrastruktura vzdálené komunikace je zřetědí v pořadí, v jakém jsou nalezeny v konfiguračním souboru. Poskytovatelé jímky kanálů se vytvoří při vytvoření kanálu během RemotingConfiguration.Configure volání.

Vlastnosti

Next

Získá nebo nastaví dalšího poskytovatele jímky v řetězu zprostředkovatele kanálu jímky.

Metody

CreateSink(IChannelSender, String, Object)

Vytvoří řetěz jímky.

Platí pro