IChannelReceiverHook 인터페이스

정의

채널 구현에서 외부 수신기 서비스로 후크할 것임을 나타냅니다.

public interface class IChannelReceiverHook
public interface IChannelReceiverHook
[System.Runtime.InteropServices.ComVisible(true)]
public interface IChannelReceiverHook
type IChannelReceiverHook = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type IChannelReceiverHook = interface
Public Interface IChannelReceiverHook
파생
특성

예제

// Implementation of 'IChannelReceiverHook' interface.
public ref class MyCustomChannel: public IChannelReceiverHook
{
private:
   bool portSet;

public:
   // Constructor for MyCustomChannel.
   MyCustomChannel( int /*port*/ )
   {
      MyChannelScheme = "http";
      portSet = true;
   }

   // Constructor for MyCustomChannel.
   MyCustomChannel()
   {
      MyChannelScheme = "http";
      portSet = false;
   }

   property bool WantsToListen 
   {
      [System::Security::Permissions::SecurityPermissionAttribute
      (System::Security::Permissions::SecurityAction::LinkDemand,
      Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
      virtual bool get()
      {
         if ( portSet )
         {
            return false;
         }
         else
         {
            return true;
         }
      }
   }

private:
   String^ MyChannelScheme;

public:
   property String^ ChannelScheme 
   {
      [System::Security::Permissions::SecurityPermissionAttribute
      (System::Security::Permissions::SecurityAction::LinkDemand,
      Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
      virtual String^ get()
      {
         return MyChannelScheme;
      }
   }

   property IServerChannelSink^ ChannelSinkChain 
   {
      [System::Security::Permissions::SecurityPermissionAttribute
      (System::Security::Permissions::SecurityAction::LinkDemand,
      Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
      virtual IServerChannelSink^ get()
      {
         
         // Null implementation.
         return nullptr;
      }
   }

   [System::Security::Permissions::SecurityPermissionAttribute
   (System::Security::Permissions::SecurityAction::LinkDemand,
   Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
   virtual void AddHookChannelUri( String^ /*channelUri*/ )
   {
      // Null implementation.
   }
};
// Implementation of 'IChannelReceiverHook' interface.
public class MyCustomChannel : IChannelReceiverHook
{
   private bool portSet;
   // Constructor for MyCustomChannel.
   public MyCustomChannel(int port)
   {
      portSet = true;
   }
   // Constructor for MyCustomChannel.
   public MyCustomChannel()
   {
      portSet = false;
   }
   public bool WantsToListen
   {
      get
      {
         if (portSet)
         {
            return false;
         }
         else
         {
            return true;
         }
      }
   }
   private string MyChannelScheme = "http";
   public string ChannelScheme
   {
      get
      {
         return MyChannelScheme;
      }
   }
   public IServerChannelSink ChannelSinkChain
   {
      get
      {
         // Null implementation.
         return null;
      }
   }
   public void AddHookChannelUri(string channelUri)
   {
      // Null implementation.
   }
}
' Implementation of 'IChannelReceiverHook' interface.
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")> _
Public Class MyCustomChannel
   Implements IChannelReceiverHook 
   Private portSet As Boolean

   ' Constructor for MyCustomChannel.
   Public Sub New(ByVal port As Integer)
      portSet = True
   End Sub

   ' Constructor for MyCustomChannel.
   Public Sub New()
      portSet = False
   End Sub

   Public ReadOnly Property WantsToListen() As Boolean Implements IChannelReceiverHook.WantsToListen
      Get
         If portSet Then
            Return False
         Else
            Return True
         End If
      End Get
   End Property

   Private MyChannelScheme As String = "http"

   Public ReadOnly Property ChannelScheme() As String Implements IChannelReceiverHook.ChannelScheme
      Get
         Return MyChannelScheme
      End Get
   End Property

   Public ReadOnly Property ChannelSinkChain() As IServerChannelSink _
                                       Implements IChannelReceiverHook.ChannelSinkChain
      Get
         ' Null implementation.
         Return Nothing
      End Get
   End Property

   Public Sub AddHookChannelUri(ByVal channelUri As String) _
                                          Implements IChannelReceiverHook.AddHookChannelUri
      ' Null implementation.
   End Sub
End Class

속성

ChannelScheme

후크할 수신기 형식을 가져옵니다.

ChannelSinkChain

현재 채널이 사용하고 있는 채널 싱크 체인을 가져옵니다.

WantsToListen

IChannelReceiverHook를 외부 수신기 서비스로 후크해야 하는지 여부를 나타내는 부울 값을 가져옵니다.

메서드

AddHookChannelUri(String)

채널 후크가 수신 대기해야 하는 URI를 추가합니다.

적용 대상