BaseChannelObjectWithProperties Class
Provides a base implementation of a channel object that exposes a dictionary interface to its properties.
System.Runtime.Remoting.Channels::BaseChannelObjectWithProperties
System.Runtime.Remoting.Channels::BaseChannelSinkWithProperties
System.Runtime.Remoting.Channels::BaseChannelWithProperties
Assembly: mscorlib (in mscorlib.dll)
The BaseChannelObjectWithProperties type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | BaseChannelObjectWithProperties | Initializes a new instance of the BaseChannelObjectWithProperties class. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of properties associated with the channel object. |
![]() | IsFixedSize | Gets a value that indicates whether the number of properties that can be entered into the channel object is fixed. |
![]() | IsReadOnly | Gets a value that indicates whether the collection of properties in the channel object is read-only. |
![]() | IsSynchronized | Gets a value that indicates whether the dictionary of channel object properties is synchronized. |
![]() | Item | When overridden in a derived class, gets or sets the property that is associated with the specified key. |
![]() | Keys | When overridden in a derived class, gets a ICollection of keys that the channel object properties are associated with. |
![]() | Properties | Gets a IDictionary of the channel properties associated with the channel object. |
![]() | SyncRoot | Gets an object that is used to synchronize access to the BaseChannelObjectWithProperties. |
![]() | Values | Gets a ICollection of the values of the properties associated with the channel object. |
| Name | Description | |
|---|---|---|
![]() | Add | Throws a NotSupportedException. |
![]() | Clear | Throws a NotSupportedException. |
![]() | Contains | Returns a value that indicates whether the channel object contains a property that is associated with the specified key. |
![]() | CopyTo | Throws a NotSupportedException. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetEnumerator | Returns a IDictionaryEnumerator that enumerates over all the properties associated with the channel object. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Remove | Throws a NotSupportedException. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() | Cast<TResult> | Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() | OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IEnumerable::GetEnumerator | Infrastructure. Returns a IEnumerator that enumerates over all the properties that are associated with the channel object. |
BaseChannelObjectWithProperties is the base class for BaseChannelWithProperties and BaseChannelSinkWithProperties.
BaseChannelWithProperties and BaseChannelSinkWithProperties can be used as the base classes for channels and channel sinks that provide named properties.
BaseChannelObjectWithProperties handles the complex task of asking a channel object for its properties.
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 InheritorsWhen you inherit from BaseChannelObjectWithProperties, you must override the Keys property and the Item property.
[PermissionSet(SecurityAction::Demand, Name="FullTrust")] private ref class LoggingServerChannelSink: public BaseChannelObjectWithProperties, public IServerChannelSink { private: IServerChannelSink^ nextSink2; bool bEnabled2; public: LoggingServerChannelSink() : nextSink2( nullptr ), bEnabled2( true ) {} LoggingServerChannelSink( IServerChannelSink^ localNextSink ) : BaseChannelObjectWithProperties() { nextSink2 = localNextSink; } virtual ServerProcessing ProcessMessage( IServerChannelSinkStack^ sinkStack, IMessage^ requestMsg, ITransportHeaders^ requestHeaders, Stream^ requestStream, [Out]IMessage^% responseMsg, [Out]ITransportHeaders^% responseHeaders, [Out]Stream^% responseStream ) = IServerChannelSink::ProcessMessage { if ( bEnabled2 ) { Console::WriteLine( "----------Request Headers-----------" ); Console::WriteLine( "{0}:{1}", CommonTransportKeys::IPAddress, requestHeaders[ CommonTransportKeys::IPAddress ] ); Console::WriteLine( "{0}:{1}", CommonTransportKeys::ConnectionId, requestHeaders[ CommonTransportKeys::ConnectionId ] ); Console::WriteLine( "{0}:{1}", CommonTransportKeys::RequestUri, requestHeaders[ CommonTransportKeys::RequestUri ] ); } sinkStack->Push( this, nullptr ); ServerProcessing processing = nextSink2->ProcessMessage( sinkStack, requestMsg, requestHeaders, requestStream, responseMsg, responseHeaders, responseStream ); switch ( processing ) { case ServerProcessing::Complete: sinkStack->Pop( this ); break; case ServerProcessing::OneWay: sinkStack->Pop( this ); break; case ServerProcessing::Async: sinkStack->Store( this, nullptr ); break; } return processing; } virtual void AsyncProcessResponse( IServerResponseChannelSinkStack^ sinkStack, Object^ /*state*/, IMessage^ msg, ITransportHeaders^ headers, Stream^ stream1 ) { sinkStack->AsyncProcessResponse( msg, headers, stream1 ); } virtual Stream^ GetResponseStream( IServerResponseChannelSinkStack^ /*sinkStack*/, Object^ /*state*/, IMessage^ /*msg*/, ITransportHeaders^ /*headers*/ ) { return nullptr; } property IServerChannelSink^ NextChannelSink { virtual IServerChannelSink^ get() { return nextSink2; } } }; [PermissionSet(SecurityAction::Demand, Name="FullTrust")] public ref class LoggingServerChannelSinkProvider: public IServerChannelSinkProvider { private: IServerChannelSinkProvider^ next2; public: LoggingServerChannelSinkProvider() : next2( nullptr ) {} LoggingServerChannelSinkProvider( IDictionary^ /*properties*/, ICollection^ /*providerData*/ ){} virtual void GetChannelData( IChannelDataStore^ /*channelData*/ ){} virtual IServerChannelSink^ CreateSink( IChannelReceiver^ channel1 ) { IServerChannelSink^ localNextSink = nullptr; if ( next2 != nullptr ) localNextSink = next2->CreateSink( channel1 ); return gcnew LoggingServerChannelSink( localNextSink ); } property IServerChannelSinkProvider^ Next { virtual IServerChannelSinkProvider^ get() { return next2; } virtual void set( IServerChannelSinkProvider^ value ) { next2 = value; } } }; }
- 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
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
