BaseChannelSinkWithProperties Class

Provides a base implementation for channel sinks that want to expose a dictionary interface to their properties.

System.Object
  System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties
    System.Runtime.Remoting.Channels.BaseChannelSinkWithProperties

Namespace:  System.Runtime.Remoting.Channels
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(true)]
[SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.Infrastructure)]
public abstract class BaseChannelSinkWithProperties : BaseChannelObjectWithProperties

The BaseChannelSinkWithProperties type exposes the following members.

  NameDescription
Protected methodBaseChannelSinkWithPropertiesInitializes a new instance of the BaseChannelSinkWithProperties class.
Top

  NameDescription
Public propertyCountGets the number of properties associated with the channel object. (Inherited from BaseChannelObjectWithProperties.)
Public propertyIsFixedSizeGets a value that indicates whether the number of properties that can be entered into the channel object is fixed. (Inherited from BaseChannelObjectWithProperties.)
Public propertyIsReadOnlyGets a value that indicates whether the collection of properties in the channel object is read-only. (Inherited from BaseChannelObjectWithProperties.)
Public propertyIsSynchronizedGets a value that indicates whether the dictionary of channel object properties is synchronized. (Inherited from BaseChannelObjectWithProperties.)
Public propertyItemWhen overridden in a derived class, gets or sets the property that is associated with the specified key. (Inherited from BaseChannelObjectWithProperties.)
Public propertyKeysWhen overridden in a derived class, gets a ICollection of keys that the channel object properties are associated with. (Inherited from BaseChannelObjectWithProperties.)
Public propertyPropertiesGets a IDictionary of the channel properties associated with the channel object. (Inherited from BaseChannelObjectWithProperties.)
Public propertySyncRootGets an object that is used to synchronize access to the BaseChannelObjectWithProperties. (Inherited from BaseChannelObjectWithProperties.)
Public propertyValuesGets a ICollection of the values of the properties associated with the channel object. (Inherited from BaseChannelObjectWithProperties.)
Top

  NameDescription
Public methodAddThrows a NotSupportedException. (Inherited from BaseChannelObjectWithProperties.)
Public methodClearThrows a NotSupportedException. (Inherited from BaseChannelObjectWithProperties.)
Public methodContainsReturns a value that indicates whether the channel object contains a property that is associated with the specified key. (Inherited from BaseChannelObjectWithProperties.)
Public methodCopyToThrows a NotSupportedException. (Inherited from BaseChannelObjectWithProperties.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns a IDictionaryEnumerator that enumerates over all the properties associated with the channel object. (Inherited from BaseChannelObjectWithProperties.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveThrows a NotSupportedException. (Inherited from BaseChannelObjectWithProperties.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorInfrastructure. Returns a IEnumerator that enumerates over all the properties that are associated with the channel object. (Inherited from BaseChannelObjectWithProperties.)
Top

Channel sinks provide a plug-in point that allows access to the underlying messages that are flowing through the channel as well as the stream that is used by the transport mechanism to send messages to a remote object. Channel sinks are linked together in a chain of channel sink providers, and all channel messages flow through this chain of sinks before the message is serialized and transported.

This class makes a link demand and an inheritance demand at the class level. A SecurityException is thrown when either the immediate caller or the derived class does not have infrastructure permission. For details about security demands, see Link Demands and Inheritance Demands.

Notes to Inheritors

When you inherit from BaseChannelSinkWithProperties, you must implement the Keys property and the Item property.

[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.Infrastructure)]
internal class MyClientFormatterChannelSink :
         BaseChannelSinkWithProperties, IClientChannelSink, IMessageSink
{
   private IClientChannelSink nextClientSink=null;
   private IMessageSink nextMessageSink = null;

   public MyClientFormatterChannelSink(IClientChannelSink nextSink,
                                       IMessageSink nextMsgSink) : base()
   {
      nextClientSink = nextSink;
      nextMessageSink = nextMsgSink;
   }

   public void ProcessMessage(IMessage msg,
         ITransportHeaders requestHeaders, Stream requestStream,
         out ITransportHeaders responseHeaders, out Stream responseStream)
   {
      nextClientSink.ProcessMessage(msg, requestHeaders, requestStream,
               out responseHeaders, out responseStream);
   }

   public void AsyncProcessRequest(IClientChannelSinkStack sinkStack,
                  IMessage msg, ITransportHeaders headers, Stream myStream)
   {
      sinkStack.Push(this, null);
      nextClientSink.AsyncProcessRequest(sinkStack,msg,headers,myStream);
   }

   public void AsyncProcessResponse(IClientResponseChannelSinkStack sinkStack,
         Object state, ITransportHeaders headers, Stream myStream)
   {
      sinkStack.AsyncProcessResponse(headers, myStream);
   }

   public Stream GetRequestStream(IMessage msg,ITransportHeaders headers)
   {
      return null;
   }

   public IClientChannelSink NextChannelSink
   {
      get
      {
         return nextClientSink;
      }
   }

   public IMessageSink NextSink
   {
      get
      {
         return nextMessageSink;
      }
   }

   public IMessageCtrl AsyncProcessMessage(IMessage msg,
                                                IMessageSink replySink)
   {
      return null;
   }

   public IMessage SyncProcessMessage(IMessage msg)
   {
      return nextMessageSink.SyncProcessMessage(msg);
   }

   public override Object this[Object key]
   {
      get
      {
         if (key == typeof(MyKey))
            return this;
         return null;
      }
      set
      {
         throw new NotSupportedException();
      }
   }
   public override ICollection Keys
   {
      get
      {
         ArrayList myKeys = new ArrayList(1);
         myKeys.Add(typeof(MyKey));
         return myKeys;
      }
   }
}
public class MyKey
{
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft