TEventType
TPayload
Intersoft ClientUI Documentation
Subscribe<TEventType,TPayload>(Action<TPayload>) Method
See Also  Send Feedback
Intersoft.Client.Framework Namespace > EventAggregator Class > Subscribe Method : Subscribe<TEventType,TPayload>(Action<TPayload>) Method






action
The delegate that gets executed when the event is published.
Subscribes a delegate to an event that will be published on the ThreadOption.PublisherThread. DelegateEvent<TPayload> will maintain a to the target of the supplied action delegate.

Syntax

Visual Basic (Declaration) 
Public Overloads Function Subscribe
     (Of TEventType As DelegateEventBase,
     TPayload)( _
   ByVal action As Action(Of TPayload) _
) As SubscriptionToken
Visual Basic (Usage)Copy Code
Dim instance As EventAggregator
Dim action As Action(Of TPayload)
Dim value As SubscriptionToken
 
value = instance.Subscribe(Of TEventType, TPayload)(action)
C# 
public SubscriptionToken Subscribe<TEventType,TPayload>( 
   Action<TPayload> action
)where TEventType: DelegateEventBase
Delphi 
public function Subscribe( 
    action: Action
): SubscriptionToken; 
JScript 
public function Subscribe( 
   action : Action
) : SubscriptionToken;
Managed Extensions for C++ 
public: SubscriptionToken* Subscribe<TEventType,TPayload>( 
   Action<TPayload*>* action
) where TEventType: DelegateEventBase
C++/CLI 
public:
SubscriptionToken^ Subscribegeneric<typename TEventType>
generic<typename TPayload>
( 
   Action<TPayload^>^ action
) where TEventType: DelegateEventBase

Parameters

action
The delegate that gets executed when the event is published.

Type Parameters

TEventType
TPayload

Return Value

A SubscriptionToken that uniquely identifies the added subscription.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.