Collapse All Expand All

C#

Oracle® Coherence .NET API Reference
WindowsFormsCacheListener Class
Members See Also

Oracle® Coherence .NET API Reference Release 3.6.1
E18812-01
Ensures that any event handling code that needs to run as a response to a cache event is executed on the UI thread.

Namespace: Tangosol.Net.Cache.Support
Assembly: Coherence (in Coherence.dll) Version: 3.6.1.0 (3.6.1.0)

# Syntax

C#
    public class WindowsFormsCacheListener : DelegatingCacheListener,
    	ICacheListener

# Remarks

The crucial limiting factor when updating UI elements from a background thread is the thread affinity Windows Forms controls and forms have to the underlying thread that created them.

All Windows messages are actually messages between threads, and each thread has its own message queue. Each and every thread message can only be processed on the thread it belongs to. When a thread creates a window, that window's messages are actually messages destined for the message queue of the creating thread. Consequently, all windows (such as forms and controls) can only process messages on the thread that created them. Method calls on forms and controls often result internally with posting of at least one such message.

This class allows end users to ignore this fact and handle Coherence cache events, which are always raised from a background thread, as if they were raised within the UI thread. This class will ensure that the call is properly marshalled and executed on the UI thread.

# Inheritance Hierarchy

System..::.Object
Tangosol.Net.Cache.Support..::.DelegatingCacheListener
Tangosol.Net.Cache.Support..::.WindowsFormsCacheListener

# See Also

WindowsFormsCacheListener Members
Tangosol.Net.Cache.Support Namespace