BaseChannelSinkWithProperties Class

 

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

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

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

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

NameDescription
System_CAPS_protmethodBaseChannelSinkWithProperties()

Initializes a new instance of the BaseChannelSinkWithProperties class.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of properties associated with the channel object.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubpropertyIsFixedSize

Gets a value that indicates whether the number of properties that can be entered into the channel object is fixed.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubpropertyIsReadOnly

Gets a value that indicates whether the collection of properties in the channel object is read-only.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubpropertyIsSynchronized

Gets a value that indicates whether the dictionary of channel object properties is synchronized.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubpropertyItem[Object^]

When overridden in a derived class, gets or sets the property that is associated with the specified key.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubpropertyKeys

When overridden in a derived class, gets a ICollection of keys that the channel object properties are associated with.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubpropertyProperties

Gets a IDictionary of the channel properties associated with the channel object.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubpropertySyncRoot

Gets an object that is used to synchronize access to the BaseChannelObjectWithProperties.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubpropertyValues

Gets a ICollection of the values of the properties associated with the channel object.(Inherited from BaseChannelObjectWithProperties.)

NameDescription
System_CAPS_pubmethodAdd(Object^, Object^)
System_CAPS_pubmethodClear()
System_CAPS_pubmethodContains(Object^)

Returns a value that indicates whether the channel object contains a property that is associated with the specified key.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubmethodCopyTo(Array^, Int32)
System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns a IDictionaryEnumerator that enumerates over all the properties associated with the channel object.(Inherited from BaseChannelObjectWithProperties.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRemove(Object^)
System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable::GetEnumerator()

This API supports the product infrastructure and is not intended to be used directly from your code. Returns a IEnumerator that enumerates over all the properties that are associated with the channel object.(Inherited from BaseChannelObjectWithProperties.)

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

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)]
private ref class MyClientFormatterChannelSink: public BaseChannelSinkWithProperties, public IClientChannelSink, public IMessageSink
{
private:
   IClientChannelSink^ nextClientSink;
   IMessageSink^ nextMessageSink;

public:
   MyClientFormatterChannelSink()
      : nextClientSink( nullptr ), nextMessageSink( nullptr )
   {}

   MyClientFormatterChannelSink( IClientChannelSink^ nextSink, IMessageSink^ nextMsgSink )
      : BaseChannelSinkWithProperties()
   {
      nextClientSink = nextSink;
      nextMessageSink = nextMsgSink;
   }

	virtual void ProcessMessage( IMessage^ message, ITransportHeaders^ requestHeaders, Stream^ requestStream, [Out]ITransportHeaders^% responseHeaders, [Out]Stream^% responseStream )
	{
      nextClientSink->ProcessMessage( message, requestHeaders, requestStream, responseHeaders, responseStream );
	}



   virtual void AsyncProcessRequest( IClientChannelSinkStack^ sinkStack, IMessage^ msg, ITransportHeaders^ headers, Stream^ myStream )
   {
      sinkStack->Push( this, nullptr );
      nextClientSink->AsyncProcessRequest( sinkStack, msg, headers, myStream );
   }

   virtual void AsyncProcessResponse( IClientResponseChannelSinkStack^ sinkStack, Object^ /*state*/, ITransportHeaders^ headers, Stream^ myStream )
   {
      sinkStack->AsyncProcessResponse( headers, myStream );
   }

   virtual Stream^ GetRequestStream( IMessage^ /*msg*/, ITransportHeaders^ /*headers*/ )
   {
      return nullptr;
   }


   property IClientChannelSink^ NextChannelSink 
   {
      virtual IClientChannelSink^ get()
      {
         return nextClientSink;
      }

   }

   property IMessageSink^ NextSink 
   {
      virtual IMessageSink^ get()
      {
         return nextMessageSink;
      }

   }

   virtual IMessageCtrl^ AsyncProcessMessage( IMessage^ /*msg*/, IMessageSink^ /*replySink*/ )
   {
      return nullptr;
   }

   virtual IMessage^ SyncProcessMessage( IMessage^ msg )
   {
      return nextMessageSink->SyncProcessMessage( msg );
   }


   property Object^ Item [Object^]
   {
      virtual Object^ get( Object^ key ) override
      {
		  if ( key == MyKey::typeid )
                  return this;

         return nullptr;
      }

      virtual void set( Object^ /*value*/, Object^ /*key*/ ) override
      {
         throw gcnew NotSupportedException;
      }

   }

   property ICollection^ Keys 
   {
      virtual ICollection^ get() override
      {
         ArrayList^ myKeys = gcnew ArrayList( 1 );
		 myKeys->Add( MyKey::typeid );
         return myKeys;
      }

   }

};



SecurityPermission

For operating with infrastructure code. Demand value: SecurityAction::LinkDemand; Permission Value: SecurityPermissionFlag::Infrastructure

SecurityPermission

For operating with infrastructure code. Demand value: SecurityAction::InheritanceDemand; Permission Value: SecurityPermissionFlag::Infrastructure

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: